Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Place the WPF checkbox control into the TableNode Cell (Read 3157 times)
Kostya
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Aug 5th, 2014
Place the WPF checkbox control into the TableNode Cell
Oct 31st, 2014 at 10:36am
Print Post  
Hi Stoyan,

Can you please give me advice how to apply style to a TableNode Cell or to place something stylable there? I would like to place a working checkbox control to the cell. I know that I can draw it (and it has the Image property also). But it would be highly desirable to take advantage of WPF styling system, to have it as a WPF style.

Thanks,
-Kostya
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Place the WPF checkbox control into the TableNode Cell
Reply #1 - Oct 31st, 2014 at 12:40pm
Print Post  
Hi,

We'll add a Cell.Template property for next release.

Stoyan
  
Back to top
 
IP Logged
 
Kostya
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Aug 5th, 2014
Re: Place the WPF checkbox control into the TableNode Cell
Reply #2 - Nov 1st, 2014 at 9:33am
Print Post  
Hi Stoyan,

Great, thanks in advance!

-Kostya
  
Back to top
 
IP Logged
 
Kostya
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Aug 5th, 2014
Re: Place the WPF checkbox control into the TableNode Cell
Reply #3 - Nov 7th, 2014 at 1:11pm
Print Post  
Quote:
We'll add a Cell.Template property for next release.

Stoyan, can you please let me know how soon this release can be expected?

Thanks,
-Kostya
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Place the WPF checkbox control into the TableNode Cell
Reply #4 - Nov 7th, 2014 at 6:16pm
Print Post  
We should release it in a few weeks. You can find initial implementation here:

https://mindfusion.eu/_beta/wpfdiag.3.2.zip

You can now display checkbox in cell like this:

Code
Select All
<Style x:Key="boolCell" TargetType="{x:Type diag:TableNode+Cell}">
	<Setter Property="Template">
		<Setter.Value>
			<DataTemplate DataType="{x:Type diag:TableNode+Cell}">
				<CheckBox IsChecked="{Binding Tag}" Content="{Binding Text}" />
			</DataTemplate>
		</Setter.Value>
	</Setter>
</Style>

table[0, 0].Text = "check me";
table[0, 0].SetValue(TagProperty, true);
table[0, 0].Style = (System.Windows.Style)FindResource("boolCell"); 



Cell now derives from FrameworkElement and inherits Tag and Tooltip dependency properties from it, but we haven't yet removed its own CLR properties, so that's why the code above uses SetValue to set the base dependency property. We'll clean up the duplicated properties for the official release.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kostya
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Aug 5th, 2014
Re: Place the WPF checkbox control into the TableNode Cell
Reply #5 - Nov 10th, 2014 at 2:37pm
Print Post  
Thank you Stoyan! This example helped me a lot.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint