public void BindOptions(WizardConfig options, ViewType mode) { this.options = options; this.mode = mode; cbxProfile.DisplayMemberPath = "Name"; cbxProfile.SelectedValuePath = "Id"; cbxProfile.ItemsSource = options.Profiles; cbxProfile.SelectedValue = options.Profiles.First().Id; }
public BaseViewModel(string profileName) { // Error = new ErrorProperties(); gCode = new ObservableCollection <string>(); GCodeFormat = Thread.Format.LinuxCNC; ZLength = 10; ZStart = 0; wz = new WizardConfig(profileName); Profiles = wz.profile.profiles; }
public BaseViewModel(string profileName) { gCode = new ObservableCollection <string>(); PassData = new ObservableCollection <string>(); GCodeFormat = Thread.Format.LinuxCNC; ZLength = 10; ZStart = 0; wz = new WizardConfig(profileName); Profiles = wz.profile.profiles; PropertyChanged += BaseViewModel_PropertyChanged; }
public ProfileDialog(WizardConfig options) { InitializeComponent(); this.options = options; this.parent = Application.Current.MainWindow; this.Title += " - " + options.ProfileName; profile.xmode = options.ActiveProfile.xmode; profile.xmodeenabled = !options.ActiveProfile.xmodelock; profile.threadVisibility = options.ProfileName == "Threading" ? Visibility.Hidden : Visibility.Visible; profile.rpmVisibility = options.ProfileName != "Threading" ? Visibility.Hidden : Visibility.Visible; profile.Profiles = options.Profiles; DataContext = profile; CopyAll(options.ActiveProfile.Profile, profile); profile.Profile = options.ActiveProfile.Profile; }