Class ViewModelFactory
This class contains methods to create a view model for a job.
public static class ViewModelFactory
  - Inheritance
 - 
      
      ViewModelFactory
 
- Inherited Members
 
Methods
CreateJobViewModel(Job)
Creates a view model for a Job.
public static JobViewModelBase CreateJobViewModel(Job job)
  Parameters
jobJobJob of the view model.
Returns
- JobViewModelBase
 A instance of a job view model.
Examples
<UserControl.Resources>
<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source = "pack://application:,,,/Loehnert.Lisrt.Laser.Keyence;component/Jobs/Views/JobViewResources.xaml"/>
    </ResourceDictionary.MergedDictionaries>
  <SolidColorBrush x:Key="JobViewAxesBrush" Color="Green"/>
  </ResourceDictionary>
</UserControl.Resources>
<ContentControl Width="500" cal:View.Model="{Binding Job}"/>
  Remarks
You must add the resource pack://application:,,,/Loehnert.Lisrt.Laser.Keyence;component/Jobs/Views/JobViewResources.xaml to your view.
You change the style using these resource keys:
| Key | Type | Comment | 
|---|---|---|
| JobViewMarkingDisabledColor | Color | |
| JobViewMarkingDisabledBrush | Brush | Default value is SolidColorBrush with color of "JobViewMarkingDisabledBrush" | 
| JobViewAxesBrush | Brush | |
| JobViewReferencePointBrush | Brush | |
| JobViewReferencePointRadius | double | Radius of the reference point in pixels | 
| JobViewBlockBoundaryThickness | double | Thickness of the block boundaries in pixels | 
Exceptions
- ArgumentNullException
 Throw when
jobis null.
CreateJobViewModelWithRulers(Job)
Creates a view model for a Job with rulers.
public static JobViewModelBase CreateJobViewModelWithRulers(Job job)
  Parameters
jobJobJob of the view model.
Returns
- JobViewModelBase
 A instance of a job view model.
Remarks
You must add the resource pack://application:,,,/Loehnert.Lisrt:Keyence;component/Jobs/Views/JobViewResources.xaml to your view.
You change the style using these resource keys, see CreateJobViewModel(Job):
| Key | Type | Comment | 
|---|---|---|
| JobViewRulerHeight | double | Height or width of the rulers in pixels. | 
Exceptions
- ArgumentNullException
 Throw when
jobis null.