void Model_NewGateOnline(byte gateId) { lock (_syncRoot) { if (_gates.Contains(gateId)) return; _gates.Add(gateId); } var gateUi = new GateUI {Model = Model.GetGateModel(gateId)}; GatesTabControl.Items.Add(new TabItem {Content = gateUi, Header = "Gate " + gateId, IsSelected = true}); }
void Model_NewGateOnline(byte gateId) { lock (_syncRoot) { if (_gates.Contains(gateId)) { return; } _gates.Add(gateId); } var gateUi = new GateUI { Model = Model.GetGateModel(gateId) }; GatesTabControl.Items.Add(new TabItem { Content = gateUi, Header = "Gate " + gateId, IsSelected = true }); }