Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
hauerCodes committed Dec 16, 2014
1 parent e4eb2f1 commit a190de9
Show file tree
Hide file tree
Showing 20 changed files with 279 additions and 502 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace NumberRecognizer.App.Common
{
/// <summary>
///
/// </summary>
public static class SelectionChangedCommand
{
/// <summary>
/// The command property
/// </summary>
public static readonly DependencyProperty CommandProperty =
DependencyProperty.RegisterAttached("Command", typeof(ICommand),
typeof(SelectionChangedCommand), new PropertyMetadata(null, OnCommandPropertyChanged));

/// <summary>
/// Sets the command.
/// </summary>
/// <param name="d">The d.</param>
/// <param name="value">The value.</param>
public static void SetCommand(DependencyObject d, ICommand value)
{
d.SetValue(CommandProperty, value);
}

/// <summary>
/// Gets the command.
/// </summary>
/// <param name="d">The d.</param>
/// <returns></returns>
public static ICommand GetCommand(DependencyObject d)
{
return (ICommand)d.GetValue(CommandProperty);
}

/// <summary>
/// Called when [command property changed].
/// </summary>
/// <param name="d">The d.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
private static void OnCommandPropertyChanged(DependencyObject d,
DependencyPropertyChangedEventArgs e)
{
var control = d as ListViewBase;
if (control != null)
control.SelectionChanged += OnSelectionChanged;
}

/// <summary>
/// Called when [item click].
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="ItemClickEventArgs" /> instance containing the event data.</param>
private static void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var control = sender as ListViewBase;
var command = GetCommand(control);

if (command != null && command.CanExecute(e))
command.Execute(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
// <copyright file="TrainingImageRT.cs" company="FH Wr.Neustadt">
// <copyright file="LocalTrainingImage.cs" company="FH Wr.Neustadt">
// Copyright Markus Zytek. All rights reserved.
// </copyright>
// <author>Markus Zytek</author>
Expand All @@ -16,21 +16,21 @@ namespace NumberRecognizer.App.DataModel
/// <summary>
/// Training Image RT.
/// </summary>
public class TrainingImageRT
public class LocalTrainingImage
{
/// <summary>
/// Initializes a new instance of the <see cref="TrainingImageRT"/> class.
/// Initializes a new instance of the <see cref="LocalTrainingImage"/> class.
/// </summary>
public TrainingImageRT()
public LocalTrainingImage()
{
this.Image = new TrainingImage();
}

/// <summary>
/// Initializes a new instance of the <see cref="TrainingImageRT"/> class.
/// Initializes a new instance of the <see cref="LocalTrainingImage"/> class.
/// </summary>
/// <param name="image">The image.</param>
public TrainingImageRT(TrainingImage image)
public LocalTrainingImage(TrainingImage image)
: this()
{
this.Image = image;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class NetworkInfoGroup
/// </summary>
public NetworkInfoGroup()
{
this.InitializeProperties();
this.InitializeCommands();
this.Networks = new ObservableCollection<NetworkInfo>();
}

/// <summary>
Expand Down Expand Up @@ -67,36 +66,5 @@ public NetworkInfoGroup(string uniqueId, string title)
/// </value>
public ObservableCollection<NetworkInfo> Networks { get; set; }

/// <summary>
/// Gets the click title command.
/// </summary>
/// <value>
/// The click title command.
/// </value>
public ICommand ClickTitleCommand { get; private set; }

/// <summary>
/// Initializes the commands.
/// </summary>
private void InitializeCommands()
{
this.ClickTitleCommand = new RelayCommand(this.TitleClicked);
}

/// <summary>
/// Initializes the properties.
/// </summary>
private void InitializeProperties()
{
this.Networks = new ObservableCollection<NetworkInfo>();
}

/// <summary>
/// Titles the clicked.
/// </summary>
private void TitleClicked()
{
App.RootFrame.Navigate(typeof(GroupDetailPage), this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class TrainingImageGroup : ViewModelBase
/// </summary>
public TrainingImageGroup()
{
this.Images = new ObservableCollection<TrainingImageRT>();
this.Images = new ObservableCollection<LocalTrainingImage>();
}

/// <summary>
Expand Down Expand Up @@ -58,6 +58,6 @@ public TrainingImageGroup(string uniqueId, string title) : this()
/// <value>
/// The images.
/// </value>
public ObservableCollection<TrainingImageRT> Images { get; set; }
public ObservableCollection<LocalTrainingImage> Images { get; set; }
}
}
12 changes: 2 additions & 10 deletions NumberRecognizer/NumberRecognizer.App/NumberRecognizer.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Common\SelectionChangedCommand.cs" />
<Compile Include="Common\ItemClickCommand.cs" />
<Compile Include="Common\LoadStateEventArgs.cs" />
<Compile Include="Common\SaveStateEventArgs.cs" />
Expand All @@ -121,7 +122,7 @@
<Compile Include="Converter\DateTimeToStringConverter.cs" />
<Compile Include="DataModel\NetworkInfoGroup.cs" />
<Compile Include="DataModel\TrainingImageGroup.cs" />
<Compile Include="DataModel\TrainingImageRT.cs" />
<Compile Include="DataModel\LocalTrainingImage.cs" />
<Compile Include="Help\LabelingHelperRT.cs" />
<Compile Include="Service References\NumberRecognizerService\Reference.cs">
<AutoGen>True</AutoGen>
Expand All @@ -130,7 +131,6 @@
</Compile>
<Compile Include="ViewModel\CreateNetworkPageViewModel.cs" />
<Compile Include="ViewModel\Design\DesignGroupedNetworksPageViewModel.cs" />
<Compile Include="ViewModel\GroupDetailPageViewModel.cs" />
<Compile Include="ViewModel\GroupedImagesPageViewModel.cs" />
<Compile Include="ViewModel\GroupedNetworksPageViewModel.cs" />
<Compile Include="ViewModel\NetworkDetailPageViewModel.cs" />
Expand All @@ -144,10 +144,6 @@
<Compile Include="View\GroupedNetworksPage.xaml.cs">
<DependentUpon>GroupedNetworksPage.xaml</DependentUpon>
</Compile>
<Compile Include="View\GroupDetailPage.xaml.cs">
<DependentUpon>GroupDetailPage.xaml</DependentUpon>
<ExcludeFromStyleCop>False</ExcludeFromStyleCop>
</Compile>
<Compile Include="Help\ImageHelperRT.cs">
<ExcludeFromStyleCop>False</ExcludeFromStyleCop>
</Compile>
Expand Down Expand Up @@ -224,10 +220,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\GroupDetailPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\NetworkRecognizePage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
22 changes: 22 additions & 0 deletions NumberRecognizer/NumberRecognizer.App/Style/AppStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,26 @@
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="50" />
</Style>

<chart:ResourceDictionaryCollection x:Key="CustomColors">
<ResourceDictionary>
<SolidColorBrush x:Key="Brush1" Color="#FFFDC87A" />
</ResourceDictionary>
<ResourceDictionary>
<SolidColorBrush x:Key="Brush2" Color="#FFFD954F" />
</ResourceDictionary>
<ResourceDictionary>
<SolidColorBrush x:Key="Brush3" Color="#FFFFC45C" />
</ResourceDictionary>
<ResourceDictionary>
<SolidColorBrush x:Key="Brush4" Color="#FFFFC000" />
</ResourceDictionary>
<ResourceDictionary>
<SolidColorBrush x:Key="Brush5" Color="#FFFDA018" />
</ResourceDictionary>
<ResourceDictionary>
<SolidColorBrush x:Key="Brush6" Color="#FFFFC018" />
</ResourceDictionary>
</chart:ResourceDictionaryCollection>

</ResourceDictionary>
17 changes: 10 additions & 7 deletions NumberRecognizer/NumberRecognizer.App/View/CreateNetworkPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@
<StackPanel Orientation="Horizontal" Grid.Column="1">
<TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Style="{StaticResource CustomHeaderTextBlockStyle}"
IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
<TextBlock x:Name="pageSubtitle" Text="- Create new Network" Style="{StaticResource CustomHeaderTextBlockStyle}"
<TextBlock x:Name="pageSubtitle" Text="- Create new Network" Style="{StaticResource CustomSecondaryHeaderTextBlockStyle}"
IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
</StackPanel>
<AppBarButton Grid.Column="2" Margin="10,45,10,0" Command="{Binding LabelingCommand}" Icon="Accept"/>
<Button Grid.Column="3" Command="{Binding NextCommand}" Margin="39,59,39,0" Style="{StaticResource NavigationBackButtonNormalStyle}" RenderTransformOrigin="0.5,0.5" Background="LawnGreen">

<!--<Button Grid.Column="3" Command="{Binding NextCommand}" Margin="39,59,39,0" Style="{StaticResource NavigationBackButtonNormalStyle}"
RenderTransformOrigin="0.5,0.5" Background="LawnGreen" >
<Button.RenderTransform>
<CompositeTransform Rotation="180"/>
</Button.RenderTransform>
</Button>
</Button>-->
</Grid>
<Grid Grid.Row="1" Margin="50,50">
<Grid.ColumnDefinitions>
Expand All @@ -73,12 +74,14 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Name &#42;" FontSize="28" Margin="2" VerticalAlignment="Bottom" Foreground="OrangeRed"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="NetworkNameTextBox" Text="{Binding NetworkName}" FontSize="30"/>
<TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1" Visibility="{Binding IsNextCommandNotExecutable, Converter={StaticResource boolToVisibilityConverter}}" Text="Please write at least one number on each canvas." Style="{StaticResource SubheaderTextBlockStyle}" VerticalAlignment="Center" Foreground="Yellow"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="NetworkNameTextBox" Text="{Binding NetworkName}" FontSize="30" Margin="0,0,240,0"/>
<AppBarButton Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Command="{Binding LabelingCommand}" Label="Show Bounding Rectangles" Icon="Crop" HorizontalAlignment="Right" Margin="0,-10,110,0"/>
<AppBarButton Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Command="{Binding NextCommand}" Label="View Training Data" Icon="Forward" HorizontalAlignment="Right" Margin="0,-10,0,0" />
<TextBlock Grid.Row="1" Grid.Column="1" Visibility="{Binding IsShowHint, Converter={StaticResource boolToVisibilityConverter}}" Text="Please write at least one number on each canvas." Style="{StaticResource SubheaderTextBlockStyle}" VerticalAlignment="Center" Foreground="OrangeRed"/>
<ScrollViewer Grid.Row="2" Grid.ColumnSpan="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
Expand Down
110 changes: 0 additions & 110 deletions NumberRecognizer/NumberRecognizer.App/View/GroupDetailPage.xaml

This file was deleted.

Loading

0 comments on commit a190de9

Please sign in to comment.