private void Button_Click(object sender, RoutedEventArgs e) { var controls = OscAddress.GetChildrenWithValue(this); this.Vm = new SynthViewModel(controls); this.DataContext = Vm; Vm.Parent = this.Parent as Window; Vm.Initialize(); }
private void SetModuleAddress() { var children = OscAddress.GetChildrenWithValue(this); foreach (var child in children) { var currentVal = OscAddress.GetAddress(child.Key); var newVal = currentVal.Replace("*", moduleAddress); OscAddress.SetAddress(child.Key, newVal); } }
private void SetIndex() { int index = StartIndex; foreach (var childP in RoutesStackPanel.Children) { var childPanel = childP as StackPanel; if (childPanel == null) { continue; } var children = OscAddress.GetChildrenWithValue(childPanel); foreach (var child in children) { var currentVal = OscAddress.GetAddress(child.Key); var newVal = currentVal.Replace("*", index.ToString()); OscAddress.SetAddress(child.Key, newVal); } index++; } }