daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static readonly DependencyProperty StatusMessageProperty = DependencyProperty.Register("StatusMessage", typeof(string), typeof(EditBoxBase), new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.AffectsRender, UiPropertyChanged));
  2.  
  3.     public string StatusMessage
  4.     {
  5.         get => (string)GetValue(StatusMessageProperty);
  6.         set => SetValue(StatusMessageProperty, value);
  7.     }
  8.    
  9. <Grid x:Name="LayoutRoot" DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type impinj:EditBoxBase}}}">
  10.     <controls:TextBox x:Name="InnerTextBox" TextChanged="TextBox_TextChanged" MaxLength="20" Text="{Binding Text, RelativeSource={RelativeSource AncestorType={x:Type impinj:EditBoxBase}}, UpdateSourceTrigger=PropertyChanged}">
  11.     </controls:TextBox>
  12.    
  13. <Window.Resources>
  14.     <ResourceDictionary>
  15.         <viewModels:MainViewModelDesigner x:Key="MainViewModelDesigner" />
  16.     </ResourceDictionary>
  17. </Window.Resources>
  18. <Grid x:Name="LayoutRoot" d:DataContext="{Binding Source={StaticResource MainViewModelDesigner}}" UseLayoutRounding="True">
  19.     <Grid.RowDefinitions>
  20.         <RowDefinition x:Name="LotGridRow" Height="Auto"/>
  21.         <RowDefinition x:Name="ScrollableRegionHeaderRow" Height="Auto"/>
  22.         <RowDefinition x:Name="ScrollableRegionRow" Height="*"/>
  23.     </Grid.RowDefinitions>
  24.     <Grid x:Name="LotGrid" Grid.Row="0" Margin="30,10,0,10" HorizontalAlignment="Stretch">
  25.         <Grid.RowDefinitions>
  26.             <RowDefinition Height="Auto"/>
  27.             <RowDefinition Height="Auto"/>
  28.         </Grid.RowDefinitions>
  29.         <Grid.ColumnDefinitions>
  30.             <ColumnDefinition Width="Auto"/>
  31.             <ColumnDefinition Width="*"/>
  32.         </Grid.ColumnDefinitions>
  33.         <Label x:Name="AngleBreakPrompt" Grid.Row="0" Grid.Column="0" Content="Angle Break: " HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
  34.         <controls:NumericBox x:Name="AngleBreakCount" Grid.Row="0" Grid.Column="1" Text="{Binding AngleBreakCount1, UpdateSourceTrigger=PropertyChanged}" TextChanged="EditBoxBase_TextChanged" ValidationErrorMessage="Angle Break Validation Message #1" StatusMessage="{Binding AngleBreakCountStatusMessage1, Mode=OneWayToSource}"/>
  35.     </Grid>
  36.  
  37.     <ScrollViewer Grid.Row="1" x:Name="ScrollableRegion">
  38.         <ScrollViewer.Resources>
  39.         </ScrollViewer.Resources>
  40.         <Grid x:Name="ScrollableRegionGrid" d:DataContext="{Binding Source={StaticResource MainViewModelDesigner}}" UseLayoutRounding="True">
  41.             <Grid.RowDefinitions>
  42.                 <RowDefinition x:Name="WaferHeaderRow" Height="Auto"/>
  43.                 <RowDefinition x:Name="WaferGridRow" Height="*"/>
  44.             </Grid.RowDefinitions>
  45.  
  46.             <Border Grid.Row="1" Margin="30,15,30,15" BorderThickness="1" BorderBrush="DarkGray">
  47.                 <DataGrid x:Name="WaferDataGrid" Margin="15,15,15,15" HorizontalAlignment="Left" VerticalAlignment="Center" ItemsSource="{Binding Wafers}" AutoGenerateColumns="False" FrozenColumnCount="1" HeadersVisibility="Column" Height="Auto" SelectionMode="Single" SelectionUnit="Cell" AlternatingRowBackground="#C4EBFF" CanUserReorderColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" VirtualizingStackPanel.IsVirtualizing="false">
  48.                    <DataGrid.Columns>
  49.                         <DataGridTemplateColumn Width="80" x:Name="AngleBreakColumn">
  50.                             <DataGridTemplateColumn.CellTemplate>
  51.                                 <DataTemplate>
  52.                                     <controls:NumericBox x:Name="AngleBreakCount" Text="{Binding AngleBreakCount2, UpdateSourceTrigger=PropertyChanged}" TextChanged="EditBoxBase_TextChanged" ValidationErrorMessage="Angle Break Validation Message #2" StatusMessage="{Binding AngleBreakCountStatusMessage2, Mode=OneWayToSource}"/>
  53.                                 </DataTemplate>
  54.                             </DataGridTemplateColumn.CellTemplate>
  55.                         </DataGridTemplateColumn>
  56.                     </DataGrid.Columns>
  57.                 </DataGrid>
  58.             </Border>
  59.         </Grid>
  60.     </ScrollViewer>
  61. </Grid>
  62.    
  63. private ObservableCollection<Wafer> _waferCollection = new ObservableCollection<Wafer>();
  64.  
  65.     public ObservableCollection<Wafer> Wafers
  66.     {
  67.         get => _waferCollection;
  68.         set
  69.         {
  70.             _waferCollection = value;
  71.             OnPropertyChanged();
  72.         }
  73.     }
  74.  
  75.     private string _angleBreakCount1;
  76.  
  77.     public string AngleBreakCount1
  78.     {
  79.         get => _angleBreakCount1;
  80.         set
  81.         {
  82.             Debug.WriteLine($"{DateTime.Now:G}, In AngleBreakCount1 Setter");
  83.  
  84.             if (_angleBreakCount1 == value)
  85.                 return;
  86.             _angleBreakCount1 = value;
  87.             OnPropertyChanged();
  88.         }
  89.     }
  90.  
  91.     private string _angleBreakCountStatusMessage1;
  92.  
  93.     public string AngleBreakCountStatusMessage1
  94.     {
  95.         get => _angleBreakCountStatusMessage1;
  96.         set
  97.         {
  98.             Debug.WriteLine($"{DateTime.Now:G}, In AngleBreakCountStatusMessage1 Setter");
  99.  
  100.             if (_angleBreakCountStatusMessage1 == value)
  101.             {
  102.                 return;
  103.             }
  104.  
  105.             _angleBreakCountStatusMessage1 = value;              
  106.         }
  107.     }
  108.    
  109. private string _angleBreakCount2;
  110.  
  111.     public string AngleBreakCount2
  112.     {
  113.         get => _angleBreakCount2;
  114.         set
  115.         {
  116.             Debug.WriteLine($"{DateTime.Now:G}, In AngleBreakCount2 Setter");
  117.  
  118.             if (_angleBreakCount2 == value)
  119.             {
  120.                 return;
  121.             }
  122.  
  123.             _angleBreakCount2 = value;
  124.             OnPropertyChanged();
  125.         }
  126.     }
  127.  
  128.     private string _angleBreakCountStatusMessage2;
  129.  
  130.     public string AngleBreakCountStatusMessage2
  131.     {
  132.         get => _angleBreakCountStatusMessage2;
  133.         set
  134.         {
  135.             Debug.WriteLine($"{DateTime.Now:G}, In Elusive AngleBreakCountStatusMessage2 Setter");
  136.  
  137.             if (_angleBreakCountStatusMessage2 == value)
  138.             {
  139.                 return;
  140.             }
  141.  
  142.             _angleBreakCountStatusMessage2 = value;              
  143.         }
  144.     }
RAW Paste Data
Top