public HSwitch_ViewModel(IEventAggregator eventAggregator, params object[] settings) { Layout = new LayoutPropertyViewModel(eventAggregator, settings); Behavior = new SwitchBehaviorViewModel(eventAggregator, settings); Appearance = new SwitchAppearanceViewModel(eventAggregator, Behavior, settings); NameUC = (string)settings[2]; ////ScaleX = (double)settings[10]; //ScaleX = 1; this.eventAggregator = eventAggregator; this.eventAggregator.Subscribe(this); }
public Panel_ViewModel(IEventAggregator eventAggregator, MonitorViewModel OriginPlugin, PanelAppearanceViewModel Appearance, LayoutPropertyViewModel Layout, bool IsVisible = true) { this.OriginPlugin = OriginPlugin; this.IsVisible = IsVisible; this.Layout = Layout; this.Appearance = Appearance; this.eventAggregator = eventAggregator; this.eventAggregator.Subscribe(this); MyPluginsContainer = new BindableCollection <IPluginModel>(); System.Diagnostics.Debug.WriteLine($"entree {this} {Layout.NameUC}"); }
public RotarySwitch_ViewModel(IEventAggregator eventAggregator, RotarySwitchAppearanceViewModel Appearance, RotarySwitchBehaviorViewModel Behavior, LayoutPropertyViewModel Layout) { RotarySwitchPositions = new ObservableCollection <RotarySwitchPosition>(); this.Layout = Layout; this.Behavior = Behavior; this.Appearance = Appearance; var s = Appearance.TextFormat.MeasureString("ABC", Appearance.LabelColor); this.eventAggregator = eventAggregator; this.eventAggregator.Subscribe(this); ToolTip = "Superbe"; #if DEBUG System.Diagnostics.Debug.WriteLine($"entree {this} {Layout.NameUC}"); var types = new System.Type[] { typeof(LayoutPropertyViewModel), typeof(PushButtonAppearanceViewModel), typeof(PushButtonBehaviorViewModel) }; DataContractSerializer dcs = new DataContractSerializer(typeof(PushButton_ViewModel), types); string buffer; using (var memStream = new MemoryStream()) { dcs.WriteObject(memStream, this); buffer = Encoding.ASCII.GetString(memStream.GetBuffer()).TrimEnd('\0'); } XmlDocument docxml = new XmlDocument(); docxml.LoadXml(buffer); using (XmlTextWriter writer = new XmlTextWriter($@"j:\{this}.xml", null)) { writer.Formatting = Formatting.Indented; docxml.Save(writer); } #endif }
public A10Alt_ViewModel(IEventAggregator eventAggregator, A10AltAppearanceViewModel Appearance, LayoutPropertyViewModel Layout) { this.Layout = Layout; this.Appearance = Appearance; this.eventAggregator = eventAggregator; }