예제 #1
0
        protected override void OnAttached()
        {
            _viewModel = AssociatedObject.DataContext as ToolViewBaseModel;

            AssociatedObject.DataContextChanged += OnDataContextChanged;

            base.OnAttached();
        }
예제 #2
0
        public XamToolViewModel(ToolViewBaseModel parent)
            : base(parent)
        {
            Init(new InvokeOnMainThread());

            if (parent is XamToolViewModel xamTool)
            {
                PluginService = xamTool.PluginService;
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
        private void OnBindingContextChanged(object sender, EventArgs e)
        {
            _page      = sender as ContentView;
            _viewModel = _page?.BindingContext as ToolViewBaseModel;

            if (_viewModel != null)
            {
                _viewModel.VisibilityChanged += OnControlVisibilityChanged;
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
 private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _viewModel = AssociatedObject?.DataContext as ToolViewBaseModel;
 }
 public ParameterControlViewModel(ToolViewBaseModel parent, string uniqueId)
     : base(parent)
 {
     UniqueId = uniqueId;
 }
예제 #8
0
 public XamParameterLabelViewModel(ToolViewBaseModel parent, string uniqueId)
     : base(parent, uniqueId)
 {
     Init(new InvokeOnMainThread());
 }
예제 #9
0
 public WpfToolViewModel(ToolViewBaseModel parent)
     : base(parent)
 {
 }
예제 #10
0
 public ParameterEditViewModel(ToolViewBaseModel parent, string uniqueId)
     : base(parent, uniqueId)
 {
     IsEnabled = true;
 }