private async void BtnHambuger_Click(object sender, EventArgs e) { try { pnlSidebar.Visible = false; pnlSidebarMid.Visible = true; financialSettings.IsSideBarCollapse = true; SettingsConfigure settingsConfigure = new SettingsConfigure(); await settingsConfigure.SetSettings(financialSettings); } catch (Exception ex) { Console.WriteLine(ex.Message); MessageBox.Show("Failed to set settings"); } }
private async void HandleSettings() { try { SettingsConfigure settingsConfigure = new SettingsConfigure(); financialSettings = await settingsConfigure.GetSettings(); if (financialSettings != null) { if (financialSettings.IsSideBarCollapse) { pnlSidebar.Visible = false; pnlSidebarMid.Visible = true; } else { pnlSidebar.Visible = true; pnlSidebarMid.Visible = false; } if (financialSettings.IsShowFinancialStatus) { btnEyeHide.Visible = true; btnEyeShow.Visible = false; HandleFinancialStatus(true); } else { btnEyeHide.Visible = false; btnEyeShow.Visible = true; HandleFinancialStatus(false); } } } catch (Exception ex) { Console.WriteLine(ex.Message); MessageBox.Show("Failed to load settings"); } }
private async void BtnEyeHide_Click(object sender, EventArgs e) { try { HandleFinancialStatus(false); btnEyeShow.Visible = true; btnEyeHide.Visible = false; if (financialSettings != null) { financialSettings.IsShowFinancialStatus = false; SettingsConfigure settingsConfigure = new SettingsConfigure(); await settingsConfigure.SetSettings(financialSettings); HandleFinancialStatus(false); } } catch (Exception ex) { Console.WriteLine(ex.Message); MessageBox.Show("Failed to change visibility of financial status"); } }