Table of Contents

Class ViewModelFactory

Namespace
Loehnert.Lisrt.Laser.Keyence.Jobs.ViewModels
Assembly
Loehnert.Lisrt.Laser.Keyence.dll

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

job Job

Job 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:

KeyTypeComment
JobViewMarkingDisabledColorColor
JobViewMarkingDisabledBrushBrushDefault value is SolidColorBrush with color of "JobViewMarkingDisabledBrush"
JobViewAxesBrushBrush
JobViewReferencePointBrushBrush
JobViewReferencePointRadiusdoubleRadius of the reference point in pixels
JobViewBlockBoundaryThicknessdoubleThickness of the block boundaries in pixels

Exceptions

ArgumentNullException

Throw when job is null.

CreateJobViewModelWithRulers(Job)

Creates a view model for a Job with rulers.

public static JobViewModelBase CreateJobViewModelWithRulers(Job job)

Parameters

job Job

Job 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):

KeyTypeComment
JobViewRulerHeightdoubleHeight or width of the rulers in pixels.

Exceptions

ArgumentNullException

Throw when job is null.