Thanks alot Tom and Dale for your quick response.
The issue I was highlighting is I was not getting the Show or Show Dialog for the wpf control.
The reason is Rhino C# Project template we dont have option to add wpf pages or forms ,we can only add wpf usercontrol.
is there any reason why the wpf page or forms not showing in the add new items in RhinoCommon plugin project in Visual Studio? I am using 2019 Community Edition
But we can add windows forms.
IF we add a wpf user control, that doesnt have show or showdialog method, might be able to extend the control ,am not sure.
Thanks Dale for the link,
IF we add a new wpf user control we have the xaml like below
UI XAML will be like below
<UserControl x:Class="ImageObjectsPanel.PopUpMessage "
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ImageObjectsPanel"
</UserControl>
code behind like below
public partial class PopUpMessage : UserControl
{
public UserControl1()
{
InitializeComponent();
}
}
I udpated the above Xaml with window tag and in code behind inheriting from window instead of usercontrol , then I was able to access the show or showdialog
<Window x:Class="ImageObjectsPanel.PopUpMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ImageObjectsPanel"
mc:Ignorable="d"
Background="Gray"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
d:DesignHeight="200" d:DesignWidth="200"
Height="200" Width="300"
>
</Window>
public partial class PopUpMessage : Window
{
public PopUpMessage()
{
InitializeComponent();
}
}
After this changes I was able to display a dialog box using the show dialog, I am not sure this is stable or it can break the code in the future or it may behave differently once I deploy to other machines , I haven’t used the this for real scenarios , need to test it .
Uploaded the plugin here
[https://github.com/Nevviin/RhinoCommon/tree/master/WpfDialog]
Advanced Easter wishes