public void Supplier(SampleControl control) { if (control is ControllerA) { Console.WriteLine("ControllerVisitor'un eylemi uygulandı !"); //todo } }
public SampleControlViewModel(SampleControl mw) { Persons = new ObservableCollection<Person>(); cts = new CancellationTokenSource(); CancelCommand = new DelegateCommand(async (t) => { cts.Cancel(); }, (obj) => !cts.Token.IsCancellationRequested); RefreshCommand = new DelegateCommand(async (t) => { Persons = new ObservableCollection<Person>(); cts = new CancellationTokenSource(); for (int i = 1; i <= 100; i++) { if (cts.Token.IsCancellationRequested) { return; } var p = new Person(); p.Name = "Person " + i; p.Address = "SomethingStreet " + i * 2; var icon = new BitmapImage(); icon.BeginInit(); icon.UriSource = new Uri("https://cdn0.iconfinder.com/data/icons/users-android-l-lollipop-icon-pack/24/user-16.png"); icon.EndInit(); p.Icon = icon; Persons.Add(p); mw.grid.ScrollIntoView(p); await Task.Delay(250); } }, (obj) => true); mw.Loaded += (s, e) => { RefreshCommand.Execute(null); }; }
protected void Button2_Click(object sender, EventArgs e) { SampleControl ctr = new SampleControl(); this.Form.Controls.Add(ctr); }
public DirectChannel(string audioPath, int delay, [NotNull] AudioPlaybackEngine engine, SampleControl control = null) : base(engine) { _audioPath = audioPath; _delay = delay; _control = control ?? new SampleControl(); }
public MyDropDownList() { mySampleControl = new SampleControl(); }