12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System;
- using System.Windows.Media;
- using Comal.Classes;
- using InABox.Configuration;
- using InABox.Core;
- using InABox.DynamicGrid;
- using PRSDesktop.WidgetGroups;
- namespace PRSDesktop.Dashboards
- {
-
- public class OpenQuotesDashboardProperties : IUserConfigurationSettings, IDashboardProperties
- {
- }
- public class OpenQuotesDashboardElement : DashboardElement<OpenQuotesDashboard, QuotesDashboardGroup,
- OpenQuotesDashboardProperties>
- {
-
- }
-
- public class OpenQuotesDashboard : DynamicDataGrid<Quote>,
- IDashboardWidget<QuotesDashboardGroup, OpenQuotesDashboardProperties>
- {
- public void Setup()
- {
- Options
- .BeginUpdate()
- .Clear()
- .Add(DynamicGridOption.SelectColumns)
- .EndUpdate();
- ActionColumns.Add(new DynamicMenuColumn(CreateMenu, GetStatus));
-
- ColumnsTag = GetType().Name;
-
- Refresh(true,false);
- }
- private DynamicMenuStatus GetStatus(CoreRow row)
- {
- return DynamicMenuStatus.Enabled;
- }
- private void CreateMenu(DynamicMenuColumn menu, CoreRow? row)
- {
- }
- public void Shutdown()
- {
- }
- public void Refresh()
- {
- Refresh(false, true);
- }
- protected override void Reload(Filters<Quote> criteria, Columns<Quote> columns, ref SortOrder<Quote>? sort, Action<CoreTable?, Exception?> action)
- {
- // criteria.Add(new Filter<Quote>(x => x.Status.Active).IsEqualTo(true));
- base.Reload(criteria, columns, ref sort, action);
- }
- protected override DynamicGridStyle GetRowStyle(CoreRow row, DynamicGridStyle style)
- {
- var result = base.GetRowStyle(row, style);
- result.Background = new SolidColorBrush(Colors.Firebrick);
- result.Foreground = new SolidColorBrush(Colors.Yellow);
- return result;
- }
- public OpenQuotesDashboardProperties Properties { get; set; }
- public event LoadSettings<OpenQuotesDashboardProperties>? LoadSettings;
- public event SaveSettings<OpenQuotesDashboardProperties>? SaveSettings;
- }
- }
|