//Updaten des angezeigten UserControls, wegräumen des alten public void Update(Template src, EventData e) { var direct = new Dictionary <Type, Action> { { typeof(UcLogin), () => BringElementToFront(UcLogin.Instance) }, { typeof(UcRegister), () => BringElementToFront(UcRegister.Instance) }, { typeof(UcForgotPassword), () => BringElementToFront(UcForgotPassword.Instance) }, { typeof(UcSeries), () => BringElementToFront(UcSeries.Instance) }, { typeof(UcSerie), () => BringElementToFront(UcSerie.Instance) }, { typeof(UcAddSeries), () => BringElementToFront(UcAddSeries.Instance) }, }; @direct[e.Destination.GetType()](); if (e.ShouldDispose) { pnl_root.Controls.Remove(src); var dispose = new Dictionary <Type, Action> { { typeof(UcLogin), () => UcLogin.Reset() }, { typeof(UcRegister), () => UcRegister.Reset() }, { typeof(UcForgotPassword), () => UcForgotPassword.Reset() }, { typeof(UcSeries), () => UcSeries.Reset() }, { typeof(UcSerie), () => UcSerie.Reset() }, { typeof(UcAddSeries), () => UcAddSeries.Reset() }, }; @dispose[src.GetType()](); } }
public MainWindow() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; reg = new UcRegistrar(); log = new UcLogin(); red = new UcRedefinir(); listaPessoas = log.GetListPessoa(); listaEmpresas = log.GetListEmpresa(); xmlMet = new XmlMetodos(); conteiner.Children.Add(log); }
public MainWindow() { InitializeComponent(); //Subscriben an allen UserControls Template.Subscribe(this); //LogIn Maske Initial einblenden UcLogin login = UcLogin.Instance; pnl_root.Controls.Add(login); login.Dock = DockStyle.Fill; login.BringToFront(); }
private void LoadLoginControl(UcBase sender) { MethodName = MethodBase.GetCurrentMethod().Name; //AdminLogger.Instance.Log.Verbose(ClassName, MethodName, "Start"); try { UcLogin control = new UcLogin(); control.Dock = DockStyle.Fill; LoadChildControl(sender, control); } catch (Exception ex) { //AdminLogger.Instance.Log.Error(ClassName, MethodName, ex.ToString()); MessageBox.Show(ex.Message); } //AdminLogger.Instance.Log.Verbose(ClassName, MethodName, "End"); }