public Window1() { ColorZoneAssist.SetMode(new CheckBox(), ColorZoneMode.Accent); Hue hue = new Hue("xyz", System.Windows.Media.Color.FromArgb(1, 2, 3, 4), System.Windows.Media.Color.FromArgb(1, 5, 6, 7)); InitializeComponent(); }
public MainWindow(SampleViewModel sampleViewModel) { ColorZoneAssist.SetMode(new Button(), ColorZoneMode.Light); _sampleViewModel = sampleViewModel; this.DataContext = sampleViewModel; this.SetWindowHandle(); InitializeComponent(); }
public void ShowPassBookList(Models.Bank Bank, List <Models.PassBook> passBook) { GroupBox groupBox = (GroupBox)passBookList.FindName(Bank.ShortName + Bank.BankID); if (groupBox == null && passBook.Count != 0) { GroupBox groupBoxBank = new GroupBox(); groupBoxBank.Height = 150; groupBoxBank.Style = Application.Current.FindResource("MaterialDesignGroupBox") as Style; groupBoxBank.Margin = new Thickness(16); ColorZoneAssist.SetMode(groupBoxBank, ColorZoneMode.PrimaryDark); groupBoxBank.Header = Bank.ShortName + " (" + Models.PassBook.TotalMoneyPassBookOfBank(UserID, Bank.BankID, false).ToString("#,###", CultureInfo.GetCultureInfo("vi-VN").NumberFormat) + " đ)"; Grid grid = new Grid(); DataGrid dtgrid = new DataGrid(); dtgrid.AutoGenerateColumns = false; dtgrid.IsReadOnly = true; dtgrid.Columns.Add(SetDataGridTextColumn("Mã số", "GetID")); dtgrid.Columns.Add(SetDataGridTextColumn("Tổng số tiền gốc", "Deposit")); dtgrid.Columns.Add(SetDataGridTextColumn("Kỳ hạn gửi", "Term")); dtgrid.Columns.Add(SetDataGridTextColumn("Lãi suất năm", "InterestRates")); dtgrid.Columns.Add(SetDataGridTextColumn("Ngày mở", "SentDate")); dtgrid.SelectionChanged += Dtgrid_SelectionChanged; dtgrid.ItemsSource = passBook; grid.Children.Add(dtgrid); groupBoxBank.Content = grid; passBookList.RegisterName(Bank.ShortName, dtgrid); passBookList.RegisterName(Bank.ShortName + Bank.BankID, groupBoxBank); passBookList.ListPassBook.Children.Add(groupBoxBank); } else { DataGrid dtgrid = (DataGrid)passBookList.FindName(Bank.ShortName); if (passBook.Count != 0) { dtgrid.ItemsSource = passBook; groupBox.Header = Bank.ShortName + " (" + Models.PassBook.TotalMoneyPassBookOfBank(UserID, Bank.BankID, false).ToString("#,###", CultureInfo.GetCultureInfo("vi-VN").NumberFormat) + " đ)"; LoadTextBlockPassBook(); } else { RemoveGroupBoxBlank(); } } LoadWallet(); }