private void BindingInit()
        {
            Binding bind_RealMode = new Binding()
            {
                Source = Settings.Instance,
                Mode   = BindingMode.TwoWay,
                Path   = new PropertyPath("IsRealTime")
            };

            TBN_RealMode.SetBinding(ToggleButton.StatusProperty, bind_RealMode);

            Binding bind_RefreshInterval = new Binding()
            {
                Source    = Settings.Instance,
                Mode      = BindingMode.OneWay,
                Path      = new PropertyPath("DataRefreshInterval"),
                Converter = new IntervalConverter()
            };

            TB_RefreshInterval.SetBinding(TextBox.TextProperty, bind_RefreshInterval);
        }
Esempio n. 2
0
        private void BindingInit()
        {
            Binding bind_RealMode = new Binding()
            {
                Source = Bas.settings,
                Mode   = BindingMode.TwoWay,
                Path   = new PropertyPath("IsRealTime")
            };

            TBN_RealMode.SetBinding(ToggleButton.StatusProperty, bind_RealMode);

            Binding bind_RefreshInterval = new Binding()
            {
                Source              = Bas.settings,
                Mode                = BindingMode.TwoWay,
                Path                = new PropertyPath("DataRefreshInterval"),
                Converter           = new IntervalConverter(),
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            };

            TB_RefreshInterval.SetBinding(TextBox.TextProperty, bind_RefreshInterval);
        }