viewpoint-particle

Author Topic: More on CLR and WPF in WB  (Read 2069 times)

stanl

  • Pundit
  • *****
  • Posts: 808
More on CLR and WPF in WB
« 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"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpg="clr-namespace:WPG;assembly=WPG"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <wpg:PropertyGrid AutomaticlyExpandObjects="False"  Width="320" Foreground="BlanchedAlmond" Instance="{Binding ElementName=myGrid}" x:Name="wpgMyControl" ShowDescription="False" ShowPreview="false"  />
    </Grid>
</Window>


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....

NO

YES but not in current WB version

YES but so what; grid would display only

READ THIS BOOK.


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.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: More on CLR and WPF in WB
« Reply #1 on: May 08, 2014, 03:20:39 pm »
It appears that XAML expects a custom assembly named WPG

Code: Winbatch
xmlns:wpg="clr-namespace:WPG;assembly=WPG"
 

Reference: http://msdn.microsoft.com/en-us/library/ms752059(v=vs.110).aspx

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

Code: Winbatch
ObjectClrOption('appbase','C:\{SOMEPATH}\')
ObjectClrOption("use","WPG")
 

No idea if that would even work....Maybe someone with more familiarity of XAML and custom classes will chime in.
Deana F.
Technical Support
Wilson WindowWare Inc.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Deana F.
Technical Support
Wilson WindowWare Inc.