WinBatch Technical Support Forum

Archived Boards => COM Automation and dotNet => Topic started by: stanl on May 08, 2014, 01:12:52 pm

Title: More on CLR and WPF in WB
Post by: stanl on May 08, 2014, 01:12:52 pm
I attached a simple mod to Deana's script (from the last thread). Now comes the question. It appears that WPF can be implemented  through 'associating' the correct presentation dlls to some C# code, then creating an xaml file that references the class used in the C# code.  For example, to house a grid
Code: [Select]
<Window x:Class="WpfApplication1.MainWindow"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
        <wpg:PropertyGrid AutomaticlyExpandObjects="False"  Width="320" Foreground="BlanchedAlmond" Instance="{Binding ElementName=myGrid}" x:Name="wpgMyControl" ShowDescription="False" ShowPreview="false"  />

So, thought I would ask: Can the 'associations' be accomplished with WB, so that xaml (like above) can be loaded, then associated with C# to populate a grid (from the WPF grid class).

I anticipate....


YES but not in current WB version

YES but so what; grid would display only


Be kind. After 41 years of marriage, taking my first class tonight to learn how to dance with my wife, as we plan to surprise our daughter by dancing to "Wagon Wheel" (Old Crow Medicine Show) at her wedding this fall.
Title: Re: More on CLR and WPF in WB
Post by: Deana on May 08, 2014, 03:20:39 pm
It appears that XAML expects a custom assembly named WPG

Code: Winbatch


Not exactly sure how to reference the assembly from your WinBatch script. I would probably start with trying something like:

Code: Winbatch

No idea if that would even work....Maybe someone with more familiarity of XAML and custom classes will chime in.
Title: Re: More on CLR and WPF in WB
Post by: Deana on May 09, 2014, 01:14:40 pm
Here is a DataGridView Sample using pure WinBatch: