14.01 Auxiliary classes. WHAT'S IN THE BOX (Wpf) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

All auxiliary files are located in the following projects.

  • CommonWpfCustomControlLibrary
  • CommonWpfUserControlLibrary
  • CommonServicesPrismModule

In addition, MainWindowViewModel.cs, MainWindow.xaml and App.xaml files were rewritten of the project

  • PrismDemoApp

the file App.config was added to the project

  • PrismDemoApp

[Classes]-folder of the CommonWpfCustomControlLibrary-project contains the following files

  • AttachedPropertiesExt.cs
    • defines Attached Properties to redirect wpf routed commands and wpf routed events into ViewModels (in terms of MVVM)
    • defines Attached Property to redirect "sort"-command of the DataGrid to the server. By default the DataGrid sorts rows locally. And DataGridServerSorting attached property changes default DataGrid sorting behavior
  • FreezableProxy.cs (inherits System.Windows.Freezable)
    • it is used to define XAML bindings
  • RoutedCommandExt.cs
    • decalres all custom routed commands which are used by generated wpf Custom User Components
  • RoutedEventExt.cs
    • decalres all custom routed Events which are used by generated wpf Custom User Components

[Helpers]-folder of the CommonWpfCustomControlLibrary-project contains the following files

  • AddEformModeEnumToVisibilityConverter (implements IValueConverter)
    • converts EformModeEnum into Visibility. If the value is equal to EformModeEnum.AddMode then wpf container is visible.
  • DelEformModeEnumToVisibilityConverter.cs
    • converts EformModeEnum into Visibility. If the value is equal to EformModeEnum.DeleteMode then wpf container is visible.
  • UpdEformModeEnumToVisibilityConverter.cs
    • converts EformModeEnum into Visibility. If the value is equal to EformModeEnum.UpdateMode then wpf container is visible.
  • CommandHelper.cs
    • implementation of ICommand-interface
  • ConvertHelper.cs
    • converts C# dynamic value into C# Built-in value types
  • FillHelper.cs
    • defines FillResourceKey Attached Property
  • InverseBooleanConverter.cs (implements IValueConverter)
  • PathHelper.cs
    • defines DataResourceKey Attached Property
  • GridFlex.cs
    • defines HorizontalFlex Attached Property. HorizontalFlex adds Flex behavior to wpf Grid.

[Themes]-folder of the CommonWpfCustomControlLibrary-project contains the following files

  • BasicResourceDictionary.xaml
    • defines a short list of icons that are used by the generated wpf Custom User components
    • defines a list of named SolidColorBrushes that are used by the generated wpf Custom User components

[Classes]-folder of the CommonWpfUserControlLibrary-project contains the following files

  • ColumnSelectorItemDef.cs
    • defines class which is used by ColumnSelectorDlgUserControl, ColumnSelectorUserControl and Sform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework)
  • WebServiceFilterDef.cs
  • WebServiceFilterMenu.cs
  • WebServiceFilterOperator.cs
  • WebServiceFilterRslt.cs
    • defines classes which is used by WebServiceFilterItemUserControl, WebServiceFilterUserControl and Sform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework)

[UserControls]-folder of the CommonWpfUserControlLibrary-project contains the following files

  • ColumnSelectorUserControl.xaml
    • defines wpf custom user control. With ColumnSelectorUserControl end user can select subset of columns to be shown in the and Sform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework)
  • ColumnSelectorDlgUserControl.xaml
    • defines dialog wrapper for the ColumnSelectorUserControl.xaml
  • MessageUserControl.xaml
    • defines wpf custom user control. MessageUserControl is used to show messages to the end user in the app.
  • MessageDlgUserControl.xaml
    • defines dialog wrapper for the MessageUserControl.xaml
  • TablePaginationUserControl.xaml
    • defines wpf custom user control. With TablePaginationUserControl, an end user can request table data page by page from the server.
  • WebServiceFilterItemUserControl.xaml
    • defines wpf custom user control. WebServiceFilterItemUserControl is used by WebServiceFilterUserControl.xaml. With WebServiceFilterUserControl, an end user can define complex data filter in Sform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework).
  • WebServiceFilterUserControl.xaml
    • defines wpf custom user control. With WebServiceFilterUserControl, an end user can define complex data filter in Sform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework).
  • NavigationProxyUserControl.xaml
  • ProxyUserControl.xaml
    • These two custom wpf controls are used when parent and child custom controls are defined in different Prism modules. In addition, two custom Prism Region adapters have been defined in PrismDemoApp-project:
      • NavigationProxyUserControlRegionAdapter.cs
      • ProxyUserControlRegionAdapter.cs

[ViewModels]-folder of the CommonWpfUserControlLibrary-project contains the following files

  • ColumnSelectorItemDefViewModel.cs
    • defines a class that has the same list of properties as ColumnSelectorItemDef.cs. ColumnSelectorItemDefViewModel implements INotifyPropertyChanged interface.
  • WebServiceFilterDefViewModel.cs
    • defines a class that has the same list of properties as WebServiceFilterDef.cs. WebServiceFilterDefViewModel implements INotifyPropertyChanged interface.
  • WebServiceFilterMenuViewModel.cs
    • defines a class that has the same list of properties as WebServiceFilterMenu.cs. WebServiceFilterMenuViewModel implements INotifyPropertyChanged interface.
  • WebServiceFilterOperatorViewModel.cs
    • defines a class that has the same list of properties as WebServiceFilterOperator.cs. WebServiceFilterOperatorViewModel implements INotifyPropertyChanged interface.
  • WebServiceFilterRsltViewModel.cs
    • defines a class that has the same list of properties as WebServiceFilterRslt.cs. WebServiceFilterRsltViewModel implements INotifyPropertyChanged interface.

[Enums]-folder of the CommonInterfacesClassLibrary-project contains the following files

  • EformModeEnum.cs
    • defines Enum which is used by Eform Usert Control for given View (View is a class with a subset of properties for the given Entity and all its masters in term of Entity Framework). Eform Usert Control can be in one of three mode
      • AddMode=1,
      • UpdateMode=2,
      • DeleteMode=3

other folders of the CommonInterfacesClassLibrary-project contain declaration of interfaces for the classes defined in following projects:

  • CommonServicesPrismModule
  • CommonWpfCustomControlLibrary
  • CommonWpfUserControlLibrary

[AppGlblSettingsSrvc]-folder of the CommonServicesPrismModule-project contains the following files

  • AppGlblSettingsService.cs
    • defines application settings global service.
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            ...
            IAppGlblSettingsService s = new AppGlblSettingsService();
            containerRegistry.RegisterInstance<IAppGlblSettingsService>(s);
            ...
        }  

[AppGlblLoginSrvc]-folder of the CommonServicesPrismModule-project contains the following files

  • AppGlblLoginService.cs
    • defines the service which implements login/logoff/register/change password Http-requests to the sever side

[CustomDlgWindows]-folder of the CommonServicesPrismModule-project contains the following files

[Models]-folder of the CommonServicesPrismModule-project contains the following files

  • BearerTokenModel.cs
  • ChangePasswordModel.cs
  • RegisterModel.cs
    • these three classes are used by AppGlblLoginService.cs to login/logout/register/change password

[UserControls]-folder of the CommonServicesPrismModule-project contains the following files

  • AccessDeniedUserControl.xaml
  • ChngpswdUserControl.xaml
  • HomeUserControl.xaml
  • LoginUserControl.xaml
  • LogoutUserControl.xaml
  • PageNotFoundUserControl.xaml
  • PageNotFoundUserControl.xaml
  • RegisterUserControl.xaml
    • these are custom user controls which implement common app functionality.
  • ScopedRegionNavigationUserControl.xaml
UserControl uc = _containerProvider.Resolve<UserControl>("LitGenreViewO2mUserControl");
IRegionManager rm = _regionManager.Regions["LitGenreViewO2mUserControlGenreFeatureFtrUserControl"].Add(uc, null, true);
_regionManager.Regions["LitGenreViewO2mUserControlGenreFeatureFtrUserControl"].Activate(uc);
// where _regionManager is injected by the constructor of the Feature ViewModel

[ViewModels]-folder of the CommonServicesPrismModule-project contains ViewModels (in terms of MVVM) for the user controls which have been defined in

  • [UserControls]-folder of the CommonServicesPrismModule-project
  • [UserControls]-folder of the CommonWpfUserControlLibrary-project

[Classes]-folder of the PrismDemoApp-project contains the following files

  • NavigationProxyUserControlRegionAdapter.cs
  • ProxyUserControlRegionAdapter.cs
    • These are two custom Prism Region adapters in addition to
      • NavigationProxyUserControl.xaml
      • ProxyUserControl.xaml
        • These two custom wpf controls are used when parent and child custom controls are defined in different Prism modules.

[ViewModels]-folder of the PrismDemoApp-project contains the following files

  • MainWindowViewModel.cs
    • this is the implementation of the ready-to-use Dashboard in the app

[Views]-folder of the PrismDemoApp-project contains the following files

  • MainWindow.xaml
    • this is the implementation of the ready-to-use Dashboard in the app

root folder of the PrismDemoApp-project contains the following files