[CONNECT Update 16 .NET] Questions about MstnPlatformNet and WPF

The MstnPlatformNET help doc mentions several classes in namespace Bentley.MstnPlatformNET.WPF.  The purpose of some classes is self-evident, but many defy immediate understanding.  The two WPF examples don't reveal a lot.  Here are a few questions about Bentley.MstnPlatformNET.WPF...

Questions about MstnPlatformNet and WPF

WpfAddIn Class

I can see that is an inheritable base class for our AddIns, but what does it do? Neither of the WPF example AddIns inherit from that class.

MstnRelayCommand Inherits from RelayCommand<Object>

What does MstnRelayCommand provide beyond the .NET RelayCommand<Object>? I can see a number of properties (AcceleratorString …Visibility). Is there any additional functionality?

HostedControl Class

Where should we use a HostedControl? Neither of the WPF examples demonstrate the use of that class.

There are plenty more questions I  could ask, but three is enough for now.


Glossary: WPF is Microsoft Windows Presentation Foundation.

Parents
  • Hi Jon,

    concerning MstnRelayCommand: Relay Command is standard part of WPF, namely MVVM pattern, so it's self-describing.

    I recommend to read WPF chapter in MicroStationAPI doc, where details about how MVVM pattern is supported are available. And, any WPF / MVVM tutorial would also provide information about classes and interfaces, used in WPF.

    With regards,

      Jan

  • I recommend to read WPF chapter in MicroStationAPI doc

    Thanks for reminding me about the unexpected .NET technology help in the C++ documentation!

    I note this comment: We also encourage you to discuss this topic further with us to make our MVVM classes the best they can be. More examples are always welcome, particularly of those classes (which is most of them) that are not mentioned in the two existing SDK examples.

    WpfAddIn Class

    I can see that WpfAddIn is an inheritable base class for our AddIns, but what does it do?  The example WPF AddIns don't inherit from that base class, and seem to work OK.

     
    Regards, Jon Summers
    LA Solutions

  • Hi ,

    As you observed and Jan mentioned WpfAddin class is not typically used/required except when there is a need to apply application specific WpfTheme. I could not locate any such code being used in MicroStation or, other applications for that matter. 

    The best summary information I could extrapolate would be the following:

    The WpfAddin class is available tor an MDL application to ensure it is properly registered using our domain and app scheme (via LoadAddIn method) thereby supplying a reference module (typically self) from which all components would inherit the application's WpfTheme and ThemeStyleAttribute. If needed and not registered/implemented properly WpfThemes have the potential to affect other WPF applications.  So if you need to troubleshoot style issues, start by removing any [ThemeStyle] attributes and/or <Style> elements within your application, then incrementally add each back to reveal if a specific style may be causing issues.

    Both MstnRelayCommand (used behind Ribbon Button behaviors and actions) and HostedControl (lowest layer between our WPF implementation and Windows Controls layer) and should be considered internal classes to MicroStation; since currently it difficult to discern and (clearly) publish .NET internal vs. external assembly scope; e.g. what is for public consumption vs internal use.  In order to provide that level of clarity we could need to review and move all (intended) "internal" assemblies into an easily identifiable location; e.g. ..\Assemblies\System\...

    Let me know; possibly by task/functionality you are trying to achieve; if we can provide more information.

    HTH,
    Bob



    Answer Verified By: Jon Summers 

Reply
  • Hi ,

    As you observed and Jan mentioned WpfAddin class is not typically used/required except when there is a need to apply application specific WpfTheme. I could not locate any such code being used in MicroStation or, other applications for that matter. 

    The best summary information I could extrapolate would be the following:

    The WpfAddin class is available tor an MDL application to ensure it is properly registered using our domain and app scheme (via LoadAddIn method) thereby supplying a reference module (typically self) from which all components would inherit the application's WpfTheme and ThemeStyleAttribute. If needed and not registered/implemented properly WpfThemes have the potential to affect other WPF applications.  So if you need to troubleshoot style issues, start by removing any [ThemeStyle] attributes and/or <Style> elements within your application, then incrementally add each back to reveal if a specific style may be causing issues.

    Both MstnRelayCommand (used behind Ribbon Button behaviors and actions) and HostedControl (lowest layer between our WPF implementation and Windows Controls layer) and should be considered internal classes to MicroStation; since currently it difficult to discern and (clearly) publish .NET internal vs. external assembly scope; e.g. what is for public consumption vs internal use.  In order to provide that level of clarity we could need to review and move all (intended) "internal" assemblies into an easily identifiable location; e.g. ..\Assemblies\System\...

    Let me know; possibly by task/functionality you are trying to achieve; if we can provide more information.

    HTH,
    Bob



    Answer Verified By: Jon Summers 

Children