protected override void OnAttached() { _viewModel = AssociatedObject.DataContext as ToolViewBaseModel; AssociatedObject.DataContextChanged += OnDataContextChanged; base.OnAttached(); }
public XamToolViewModel(ToolViewBaseModel parent) : base(parent) { Init(new InvokeOnMainThread()); if (parent is XamToolViewModel xamTool) { PluginService = xamTool.PluginService; } }
public StreemaStationViewModel(ToolViewBaseModel parent, int stationIndex) : base(parent) { _stationIndex = stationIndex; _stationIdParameter = new XamParameterEditViewModel(this, $"PARAM_Station_{stationIndex+1}_Id"); _stationVolumeScalingParameter = new XamParameterEditViewModel(this, $"PARAM_Station_{stationIndex+1}_VolumeScaling"); DeviceInitialized += OnDeviceInitialized; }
private void OnBindingContextChanged(object sender, EventArgs e) { _page = sender as ContentView; _viewModel = _page?.BindingContext as ToolViewBaseModel; if (_viewModel != null) { _viewModel.VisibilityChanged += OnControlVisibilityChanged; } }
protected override void OnAttachedTo(ContentView page) { _page = page; _viewModel = page.BindingContext as ToolViewBaseModel; page.BindingContextChanged += OnBindingContextChanged; if (_viewModel != null) { _viewModel.VisibilityChanged += OnControlVisibilityChanged; } base.OnAttachedTo(page); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { _viewModel = AssociatedObject?.DataContext as ToolViewBaseModel; }
public ParameterControlViewModel(ToolViewBaseModel parent, string uniqueId) : base(parent) { UniqueId = uniqueId; }
public XamParameterLabelViewModel(ToolViewBaseModel parent, string uniqueId) : base(parent, uniqueId) { Init(new InvokeOnMainThread()); }
public WpfToolViewModel(ToolViewBaseModel parent) : base(parent) { }
public ParameterEditViewModel(ToolViewBaseModel parent, string uniqueId) : base(parent, uniqueId) { IsEnabled = true; }