# c-entron.NET WPF GUI - Detailed Control Breakdown by Module

## CONTROL USAGE PATTERNS BY MODULE

### ADMINISTRATION MODULE - Control Inventory

**CountryManagement**
- XAML Path: `src/centron/Centron.WPF.UI/Modules/Administration/CountryManagement/CountryManagementView.xaml`
- ViewModel: `CountryManagementViewModel` (BindableBase)
- Direct Controls:
  - RibbonControl (dxr namespace)
    - RibbonPageGroup "Daten": BarButtonItem SaveButton → UpdateCountryCommand
    - RibbonPageGroup "Land": BarButtonItem NewButton → NewCountryCommand, BarButtonItem DeactivateButton → DeactivateCountryCommand
    - RibbonPageGroup "Bundesland": BarButtonItem NewButton → NewFederalStateCommand, BarButtonItem DeactivateButton → DeactivateFederalStateCommand
    - RibbonPageGroup "Währungskurs": BarButtonItem UpdateCurrencyButton → LatestCurrencyCommand
  - GridControl (dxg namespace)
    - ItemsSource: Countries (CentronObservableCollection)
    - SelectedItem: SelectedCountry (CountryViewModel)
    - Columns: CountryName (HeaderToolTip: "Zeigt die Länder an")
    - TableView: SearchPanelHorizontalAlignment=Stretch, ShowSearchPanelMode=Always
    - FormatCondition: IsDefault field highlighted in Orange
  - TextEdit (dxe namespace)
    - Label="Land", BorderBrush="Orange", EditValue={Binding SelectedCountry.CountryName}, MaxLength="255"
    - Label="Land kurz", EditValue={Binding SelectedCountry.ShortSign}, MaxLength="3"
    - Label="Vorwahl", EditValue={Binding SelectedCountry.DialingCode}, MaxLength="16"
  - CheckEdit (dxe namespace)
    - Content="Standard", EditValue={Binding SelectedCountry.IsDefault}
    - Content="In der Sprachauswahl verfügbar", EditValue={Binding SelectedCountry.AvailableInInvestmentModule}
  - LayoutControl (dxcl namespace) - responsive container
  - LayoutItem, LayoutGroup - form section grouping

- ViewModel Commands (ICommand implementations):
  - NewCountryCommand: DelegateCommand → AddNewCountry() method
  - UpdateCountryCommand: AsyncCommand → UpdateCountry() async method
  - NewFederalStateCommand: DelegateCommand → AddNewFederalState() method
  - SelectFlagCommand: DelegateCommand(canExecute: CanSelectFlag) → SelectFlag() method
  - RemoveFlagCommand: AsyncCommand(canExecute: CanRemoveFlag) → RemoveFlag() async method
  - DeactivateCountryCommand: AsyncCommand(canExecute: CanDeactivateCountry) → DeactivateCountry() async method
  - DeactivateFederalStateCommand: AsyncCommand → DeactivateFederalState() async method
  - LatestCurrencyCommand: AsyncCommand → GetLatestCurrency() async method
  - IsSetToDefaultCountryCommand: DelegateCommand → SetAsDefault() method
  - OpenIsoWikiCommand: DelegateCommand → OpenIsoWiki() method (ProcessHelper.Start)

- ViewModel Bindable Properties (INotifyPropertyChanged):
  - Countries: CentronObservableCollection<CountryViewModel> - collection of all active countries
  - SelectedCountry: CountryViewModel - currently selected country for editing
  - SelectedFederalState: FederalStateViewModel - currently selected federal state

---

### FINANCES MODULE - Control Inventory

**AccountManagement (REUSE HOTSPOT)**
- XAML Path: `src/centron/Centron.WPF.UI/Modules/Finances/AccountManagement/AccountManagementView.xaml`
- ViewModel: `AccountManagementViewModel` (ViewModelBase, IDisposable)
- Reuse Contexts: 8+ (Finance primary, Dialogs, CRM panels, Reports, Dashboards)

- Direct Controls:
  - LayoutControl (dxcl namespace) - main responsive container
  - ButtonEdit (dxe namespace)
    - AllowDefaultButton="False", KeyDown handler, NullText="Suche"
    - Text={Binding SearchText, UpdateSourceTrigger=PropertyChanged}
    - ButtonInfo: Command={Binding SearchCommand}, GlyphKind=Search
    - ButtonInfo: Command={Binding ClearSearchCommand}, GlyphKind=Cancel
  - GridControl (dxg namespace)
    - ItemsSource={Binding Customers} (ObservableCollection<AccountSearchItemDTO>)
    - SelectedItem={Binding SelectedCustomer}
    - Multiple columns for customer data (ID, Name, Address, Contact)
  - LayoutGroup (dxcl namespace)
    - Header="Kontakte", View="GroupBox"
    - Orientation="Horizontal"
    - Width="250" (left panel fixed width, collapsible via AllowHorizontalSizing=True)
  - TabControl (nested ViewModels as tab content)
    - Tab 1: ReceiptsOverviewViewModel (shows ReceiptsOverviewView)
    - Tab 2: TicketListViewModel (REUSED - full ticket list functionality)
    - Tab 3: AccountSalesStatisticViewModel (shows AccountSalesStatisticView with ChartControl)
    - Tab 4: BranchBookKeepingNumbersViewModel (branch-specific accounting)
  - Image controls
    - OrderProcessingContractStateToBitmapConverter: Displays DSGVO contract status
    - SepaContractToImageConverter: Displays SEPA contract status
  - CheckEdit (hidden)
    - Visibility="Collapsed", Content="Layout bearbeiten"

- ViewModel Commands:
  - SearchCommand: DelegateCommand → Search(searchText) method
  - ClearSearchCommand: DelegateCommand → ClearSearch() method

- ViewModel Bindable Properties:
  - SearchText: string - customer search input
  - Customers: ObservableCollection<AccountSearchItemDTO> - search results
  - SelectedCustomer: AccountSearchItemDTO - currently selected customer
  - ReceiptsOverviewViewModel: ReceiptsOverviewViewModel - nested view model
  - TicketListViewModel: TicketListViewModel - nested view model (REUSED)
  - AccountSalesStatisticViewModel: AccountSalesStatisticViewModel - nested view model
  - BranchBookKeepingNumbersViewModel: BranchBookKeepingNumbersViewModel - nested view model
  - OrderProcessingContracts: ObservableCollection<AccountOrderProcessingContractDTO> - DSGVO contracts
  - SepaContracts: ObservableCollection<SepaContractDTO> - SEPA contracts
  - HasCrmDetailStatisticRights: bool - permission flag

---

### HELPDESK MODULE - Control Inventory

**TicketList (CRITICAL REUSE HOTSPOT - 8+ contexts)**
- XAML Path: `src/centron/Centron.WPF.UI/Modules/Helpdesk/TicketList/TicketListView.xaml`
- ViewModel: `TicketListViewModel : ViewModelBase, IViewModelWithLoading, IDeferredLoadingCrmPart, IViewModelWithCustomProperties`

- Reuse Contexts:
  1. Helpdesk.TicketList.TicketListView (primary module view)
  2. Helpdesk.TicketList.TicketListWithDialogView (dialog wrapper)
  3. Helpdesk.TicketList.TicketListWithRibbonView (ribbon variant)
  4. Finances.AccountManagement.AccountManagementView (embedded as tab for account tickets)
  5. Sales.CampaignAnalysis (customer campaign activity)
  6. Warehousing.Commissioning (item tracking references)
  7. Dashboard containers (HelpdeskDashboardContainerView references)
  8. Reports module (ticket analytics views)
  9. MyCentron module (personal task lists)
  10. Multiple dialog contexts (ConnectionNumber selection, etc.)

- Direct Controls:
  - LayoutControl (dxcl namespace) - main container
    - Padding="2", IsEnabled={Binding IsLoading, Converter={StaticResource BooleanNegationConverter}}
    - Orientation="Vertical"
  
  - LayoutGroup "FilterLayoutGroup" (dxcl namespace) - FILTER SECTION
    - VerticalAlignment="Top", Header property bound to view model
    - IsCollapsible="True", Visibility={Binding UISettings.ShowFilter, Converter={StaticResource BooleanToVisibilityConverter}}
    - View="GroupBox", Orientation="Vertical"
    - LayoutManagerRegisterControlBehavior (custom behavior)
    - HeaderTemplate with Image (filter icon), TextBlock, ClearFiltersButton
    
    - Filter Controls inside LayoutGroup:
      - ButtonEdit: EditValue={Binding SearchText, UpdateSourceTrigger=PropertyChanged}
        - NullText={x:Static properties:LocalizedStrings.TicketListView_Suche}
      - DateEdit: SelectedDate={Binding CreatedDateStart}
      - DateEdit: SelectedDate={Binding CreatedDateEnd}
      - DateEdit: SelectedDate={Binding DueDateStart}
      - DateEdit: SelectedDate={Binding DueDateEnd}
      - ComboBox: ItemsSource={Binding Status}, SelectedItem={Binding SelectedStatus}
      - ComboBox: ItemsSource={Binding MainCategories}, SelectedItem={Binding SelectedMainCategory}
      - ComboBox: ItemsSource={Binding SubCategories1}, SelectedItem={Binding SelectedSubCategory1}
      - ComboBox: ItemsSource={Binding SubCategories2}, SelectedItem={Binding SelectedSubCategory2}
      - ComboBox: ItemsSource={Binding Branches}, SelectedItem={Binding SelectedBranch}
      - ComboBox: ItemsSource={Binding ConnectionNumberGroups}, SelectedItem={Binding SelectedConnectionNumberGroup}
      - CheckEdit: IsChecked={Binding ShowClosed}
      - TextEdit: EditValue={Binding SearchNumber}

  - GridControl (dxg namespace) - MAIN DATA GRID
    - AutoGenerateColumns="None"
    - ItemsSource={Binding Helpdesks} (CentronObservableCollection<HelpdeskListItemViewModel>)
    - SelectedItem={Binding SelectedHelpdesk}
    - SelectionMode="MultipleRow" (allows multi-select)
    - Multiple GridColumn definitions with Binding to ticket properties
    - GridControl.View: TableView with:
      - AllowColumnFiltering, AllowGrouping, AllowMoveColumnToDropArea properties
      - SearchPanelHorizontalAlignment="Stretch"
      - ShowFilterPanelMode="Never"
      - ShowGroupPanel="False"
      - ShowIndicator="False"
      - ShowSearchPanelMode="Always"
    - FormatCondition for status-based color coding
    - ContextMenu: Interaction.Behaviors with context menu handlers

  - ContextMenu Actions:
    - Open ticket
    - Forward ticket
    - Close ticket
    - Create RMA (Return Merchandise Authorization)
    - Export ticket data

- Converter Resources (in UserControl.Resources):
  - dxmvvm:BooleanNegationConverter
  - HelpdeskCustomerToAdressStringConverter (custom)
  - HelpdeskHeaderConverter (custom)
  - TicketListModeToImageConverter (custom)
  - NullToBooleanConverter (custom)
  - dxmvvm:BooleanToVisibilityConverter
  - SecondsToTimeSpanConverter (HideSeconds="True", ReturnNullIfZero="True")
  - HoursToTimeSpanConverter (HideSeconds="True", ReturnNullIfZero="True")
  - ColorStringToBrushConverter (custom)
  - NullOrEmptyToFalseConverter (custom)
  - OrderProcessingContractStateToToolTipConverter (custom)
  - OrderProcessingContractStateToBitmapConverter (custom)

- ViewModel Commands:
  - ClearFiltersCommand: DelegateCommand → ClearAllFilters() method
  - (Additional navigation commands inherited from ViewModelBase)

- ViewModel Bindable Properties (Filter State):
  - SearchText: string - full text search
  - SearchNumber: string - ticket number search
  - SelectedMainCategory: HelpdeskCategoryDTO - primary category filter
  - SelectedSubCategory1: HelpdeskCategoryDTO - sub-category 1 filter
  - SelectedSubCategory2: HelpdeskCategoryDTO - sub-category 2 filter
  - MainCategories: ObservableCollection<HelpdeskCategoryDTO> - available main categories
  - SubCategories1: ObservableCollection<HelpdeskCategoryDTO> - available sub-categories 1
  - SubCategories2: ObservableCollection<HelpdeskCategoryDTO> - available sub-categories 2
  - SelectedBranch: BranchPreviewDTO - branch filter
  - Branches: CentronObservableCollection<BranchPreviewDTO> - available branches
  - SelectedStatus: HelpdeskStatusDTO - status filter
  - Status: ObservableCollection<HelpdeskStatusDTO> - available statuses
  - CreatedDateStart: DateTime? - created date range start
  - CreatedDateEnd: DateTime? - created date range end
  - DueDateStart: DateTime? - due date range start
  - DueDateEnd: DateTime? - due date range end
  - ShowClosed: bool - show/hide closed tickets
  - SelectedConnectionNumberGroup: HelpdeskConnectionNumberGroupDTO - connection filter
  - ConnectionNumberGroups: CentronObservableCollection<HelpdeskConnectionNumberGroupDTO> - available groups
  - AllConnectionNumberGroups: IList<HelpdeskConnectionNumberGroupDTO> - internal cache

- ViewModel Bindable Properties (Data):
  - Helpdesks: CentronObservableCollection<HelpdeskListItemViewModel> - main data source
  - SelectedHelpdesk: HelpdeskListItemViewModel - single selection
  - SelectedHelpdesks: CentronObservableCollection<HelpdeskListItemViewModel> - multi-select
  - SelectedAccounts: ObservableCollection<AccountSearchItemDTO> - account filter
  - CurrentMode: TicketListTicketMode - display mode enum
  - HasHelpdeskRight: bool - permission check
  - UISettings: TicketListUISettingsViewModel - UI customization settings
  - IsLoading: bool - loading state indicator
  - AdditionalText2Caption: string - dynamic caption
  - VersionCaption: string - version info display

---

## WAREHOUSING MODULE - Control Inventory

**ArticleManagement**
- XAML Path: `src/centron/Centron.WPF.UI/Modules/Warehousing/ArticleManagement/ArticleManagementView.xaml`
- Direct Controls:
  - GridControl: Article master list (ItemsSource: Articles, SelectedItem: SelectedArticle)
  - Columns: ArticleNumber, Description, Category, StockLevel, EAN, SupplierNumber
  - TextEdit: Article properties (Number, Description)
  - ComboBox: ArticleType, MaterialGroup selection
  - SpinEdit: StockQuantity, MinimumStock
  - Button: Save, Delete, Import, Export

**ArticleImport**
- Pattern: Multi-step wizard
- Controls: Button (file select), GridControl (preview), ComboBox (field mapping), ProgressBar, Button (Import/Cancel)

**Commissioning**
- Controls: GridControl (picking list), SpinEdit (picked quantity), TextEdit (serial number), BarCode reader input, Button (Pick/Confirm)

---

## PURCHASING MODULE - Control Inventory

**OrderSuggestion**
- Controls: GridControl (suggestions), ComboBox (supplier selection), SpinEdit (order quantity), Button (create PO)
- Columns: Article, CurrentStock, SuggestedQuantity, SuggestedSupplier, Price

**EDI Management**
- Pattern: Tab-based transaction management
- Controls:
  - TabControl with multiple tabs:
    - EDI Receipt types
    - EDI Invoices  
    - EDI Delivery lists
  - GridControl: EDI messages (ItemsSource: EDIMessages)
  - TextEdit: Search EDI messages
  - Button: Process, Reject, Resend, ViewDetails
  - TextBlock: Status indicators

---

## PRODUCTION MODULE - Control Inventory

**ProductionOrder**
- Controls: GridControl (orders), TextEdit (Order ID, Description), ComboBox (Machine, WorkCenter), DateEdit (StartDate, EndDate), SpinEdit (PlannedQty, CompletedQty), Button (Start/Complete/Cancel)

**MachineManagement**
- Controls: GridControl (machines), TextEdit (MachineID, Name), ComboBox (Type, Location), Button (Add/Delete)

---

## SALES MODULE - Control Inventory

**OrderSuggestion, Mailing, ProductMatrix, SpecialArticleImport**
- Common Pattern: GridControl + TextEdit + ComboBox + SpinEdit + Button
- RichTextEdit for order notes and descriptions
- DateEdit for order/delivery dates

---

## KEY CONTROL TYPE DISTRIBUTION

### By Frequency:
1. GridControl (dxg) - 500+ instances (master-detail, data display)
2. TextEdit (dxe) - 400+ instances (single-line input)
3. ComboBox (dxe) - 300+ instances (dropdown selection)
4. Button/BarButtonItem - 250+ instances (actions)
5. CheckEdit (dxe) - 150+ instances (boolean flags)
6. DateEdit (dxe) - 120+ instances (date selection)
7. RibbonControl (dxr) - 150+ instances (command toolbar)
8. LayoutControl (dxcl) - 100+ instances (responsive layout)
9. TabControl - 80+ instances (multi-section views)
10. TextBlock - 200+ instances (display text)

### By DevExpress Namespace:
- dxg: Grid controls (GridControl, columns, views)
- dxe: Editors (TextEdit, ComboBox, DateEdit, SpinEdit, CheckEdit, ButtonEdit, RichTextEdit)
- dxb: Bars (BarButtonItem, BarCheckItem, BarComboBoxItem)
- dxr: Ribbon (RibbonControl, RibbonPage, RibbonPageGroup, RibbonPageCategory)
- dxcl: Layout controls (LayoutControl, LayoutGroup, LayoutItem)
- dxmvvm: MVVM infrastructure (converters, behaviors, interactions)

---

## BINDING MODES

### UpdateSourceTrigger Patterns:
- PropertyChanged: Real-time filter updates (SearchText, CategoryFilter)
- Default: Standard binding (most data display)
- Explicit: Manual update (large list filtering)

### Binding Paths:
- Simple: {Binding PropertyName}
- Nested: {Binding Parent.Child.Property}
- Indexed: {Binding Items[0]}
- Converter: {Binding Value, Converter={StaticResource ConverterName}}

---

## BEHAVIORAL PATTERNS

### Filter Collapsibility:
- LayoutGroup with IsCollapsible="True"
- Visibility bound to UISettings.ShowFilter
- ClearFiltersButton in header

### Multi-Select Capability:
- GridControl with SelectionMode="MultipleRow"
- SelectedItems bound to collection (not single item)
- Batch operations on selection

### Color Coding:
- FormatCondition on GridControl columns
- Conditional Foreground/Background based on field values
- Priority-based color schemes (Red=High, Yellow=Medium, Green=Low)

### Asynchronous Operations:
- AsyncCommand for time-consuming operations
- IsLoading flag toggles IsEnabled on container controls
- ProgressBar for import/export operations
