<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Modal WPF dialog in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6969973#M32168</link>
    <description>&lt;P&gt;I'll use WPF UserControls in Palettes for all my non blocking(modeless) dialogs however i can't get a Model dialog designed in WPF.&lt;/P&gt;
&lt;P&gt;AS a workaround i'll use a Windows Form containing ElementHost to load a UserControl but this gives me sometimes&amp;nbsp; issues in VS 2015 -- didn't tried Vs2017 yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll need a simple WPF dialog, asking the user a question which he must answer before continuing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 08:10:40 GMT</pubDate>
    <dc:creator>SENL1362</dc:creator>
    <dc:date>2017-03-24T08:10:40Z</dc:date>
    <item>
      <title>Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6969973#M32168</link>
      <description>&lt;P&gt;I'll use WPF UserControls in Palettes for all my non blocking(modeless) dialogs however i can't get a Model dialog designed in WPF.&lt;/P&gt;
&lt;P&gt;AS a workaround i'll use a Windows Form containing ElementHost to load a UserControl but this gives me sometimes&amp;nbsp; issues in VS 2015 -- didn't tried Vs2017 yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll need a simple WPF dialog, asking the user a question which he must answer before continuing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 08:10:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6969973#M32168</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2017-03-24T08:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970025#M32169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please use&amp;nbsp;Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow() to&amp;nbsp;show the WPF dialog as modal dialog.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 08:41:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970025#M32169</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2017-03-24T08:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970075#M32170</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello Virupaksha,&lt;/P&gt;
&lt;P&gt;At first i should am i that stupid but fortunately there is more on to it &lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://forums.autodesk.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;&lt;/P&gt;
&lt;P&gt;This is my problem, you cannot add a (WPF) UserControl directly. Somesort of canvas is required, such as a Palette or Form with ElementHost.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is needed to do show this UserControl1 as a modal dialog&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var modUc = new UserControl1();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcadApp.ShowModalWindow(modUc);&amp;nbsp; //cannot convert...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you for any help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;UserControl x:Class="TestAcadUpdate.UserControl1"
             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:TestAcadUpdate"
             mc:Ignorable="d" Height="auto" Width="auto" MinHeight="200" MinWidth="250" d:DesignHeight="200" d:DesignWidth="250"&amp;gt;

    &amp;lt;Grid Name="grdMain" Background="White"&amp;gt;
        &amp;lt;Grid.RowDefinitions&amp;gt;
            &amp;lt;RowDefinition Height="30*" /&amp;gt;
            &amp;lt;RowDefinition Name="ChkAllRow" Height="30*" /&amp;gt;
            &amp;lt;RowDefinition Height="80*" /&amp;gt;
            &amp;lt;RowDefinition Height="30*" /&amp;gt;
        &amp;lt;/Grid.RowDefinitions&amp;gt;
        &amp;lt;Grid.ColumnDefinitions&amp;gt;
            &amp;lt;ColumnDefinition Width="120*" /&amp;gt;
            &amp;lt;ColumnDefinition Width="120*" /&amp;gt;
        &amp;lt;/Grid.ColumnDefinitions&amp;gt;

    

        &amp;lt;Grid Grid.Row="0" Grid.Column="0" &amp;gt;
            &amp;lt;Label Name="lblDwgName" Content="DrawingX.dwg" HorizontalAlignment="Left" VerticalAlignment="Top" MinWidth="100" MaxWidth="250"  MinHeight="20" MaxHeight="50"  Margin="5"/&amp;gt;
        &amp;lt;/Grid&amp;gt;

        &amp;lt;Grid Grid.Row="0" Grid.Column="1" &amp;gt;
            &amp;lt;Label Name="lblTitle" Content="..." HorizontalAlignment="Left" VerticalAlignment="Top" MinWidth="100" MaxWidth="250"  MinHeight="20" MaxHeight="50"  Margin="5"/&amp;gt;
        &amp;lt;/Grid&amp;gt;

        &amp;lt;CheckBox Grid.Row="1"    Name="ChkAll" Content="SelectAll" Click="ChkAll_Click" IsThreeState="False"  Height="20"  Margin="6,3,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="103"/&amp;gt;

        &amp;lt;ListBox Grid.Row="2" Grid.ColumnSpan="2" Name="LstBox" Margin="5" SelectionMode="Single" SelectionChanged="LstBox_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Visible"/&amp;gt;

        &amp;lt;Grid  Grid.Row="3" Grid.ColumnSpan="2" &amp;gt;
            &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right"  &amp;gt;
                &amp;lt;Button  Name="btnOk" Content="OK"  MinWidth="100" MaxWidth="250"  MinHeight="20" MaxHeight="50"   Margin="5"  Click="btnOk_Click"/&amp;gt;
                &amp;lt;Button  Name="btnCancel" Content="Cancel"  MinWidth="100" MaxWidth="250" MinHeight="20" MaxHeight="50"    Margin="5" IsCancel="True"   Click="btnCancel_Click"/&amp;gt;
            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/Grid&amp;gt;

    &amp;lt;/Grid&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:02:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970075#M32170</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2017-03-24T09:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970147#M32171</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can replace "UserControl" with "Window" in the xaml and xaml.cs files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can understand French (or use an in line translator), you can see &lt;STRONG&gt;&lt;A href="http://gilecad.azurewebsites.net/UserInterfaces.aspx" target="_self"&gt;this tutorial&lt;/A&gt;&lt;/STRONG&gt; about AutoCAD user interfaces with .NET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By my side, I made a basic template for an AutoCAD WPF modal dialog using MVVM (see attached) which automatically launches AutoCAD (currently 2014) and loads the DLL when debugging from Visual Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "AutoCAD WPF Dialog.zip" have to pasted in the Visual Studio 2015 Project Templates folder, default:&lt;/P&gt;
&lt;P&gt;Documents\Visual Studio 2015\Templates\ProjectTemplates&lt;/P&gt;
&lt;P&gt;or in one of its subfoder (you can create an AutoCAD sub folder):&lt;/P&gt;
&lt;P&gt;Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\AutoCAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'd probably have to edit the AcadWpfDialog.csproj in the ZIP file to change the paths of the StartProgram, currently:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;StartProgram&amp;gt;C:\Program Files\Autodesk\AutoCAD 2014\acad.exe&amp;lt;/StartProgram&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and those or the AutoCAD libraries, currently:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;HintPath&amp;gt;C:\ObjectARX 2013\inc\AcCoreMgd.dll&amp;lt;/HintPath&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;HintPath&amp;gt;C:\ObjectARX 2013\inc\AcDbMgd.dll&amp;lt;/HintPath&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;HintPath&amp;gt;C:\ObjectARX 2013\inc\AcMgd.dll&amp;lt;/HintPath&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'd also edit the My Template.vstemplate if you want to target another .NET Framework than 4.0:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;RequiredFrameworkVersion&amp;gt;4.0&amp;lt;/RequiredFrameworkVersion&amp;gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:46:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970147#M32171</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-03-24T09:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970169#M32172</link>
      <description>Hello Gile,&lt;BR /&gt;Although not living far from Frans my knowledge of the language is limited to OUI, NO and SUPURB, which qualifies to you.&lt;BR /&gt;As usual we own you a lot credits.&lt;BR /&gt;&lt;BR /&gt;I give it a try.&lt;BR /&gt;Thanks again</description>
      <pubDate>Fri, 24 Mar 2017 09:59:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970169#M32172</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2017-03-24T09:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Modal WPF dialog</title>
      <link>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970185#M32173</link>
      <description>&lt;P&gt;OUI, it worked, all it required was changing UserControl into Window and add a few references&amp;nbsp; . You made my day. ThumpsUp&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 10:12:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/modal-wpf-dialog/m-p/6970185#M32173</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2017-03-24T10:12:16Z</dc:date>
    </item>
  </channel>
</rss>

