Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DynamicResources do not work (Read 5095 times)
Todd
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 15th, 2008
DynamicResources do not work
Apr 22nd, 2008 at 5:56pm
Print Post  
DynamicResources are not updated when using WPF Controls in a diagram. I've added a simple example that uses the SystemColors.WindowTextBrushKey as the foreground for two text blocks. One text block is added to a border the other to the diagram. If you change your Window Text color to say Red the bordered TextBlock will update, but the diagram does not. At first I thought that maybe I had to call RecreateCacheImage; however, that doesn't actually seem to exist.

<Window
x:Class="TestDiagram.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="clr-namespace:MindFusion.Diagramming.Wpf;assembly=MindFusion.Diagrammi
ng.Wpf">

<Grid>
<StackPanel>
<Border x:Name="MyBorder" />
<d:Diagram x:Name="diagram" />
</StackPanel>
</Grid>

</Window>


using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using MindFusion.Diagramming.Wpf;

namespace TestDiagram
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();

TextBlock text = new TextBlock();
text.Text = "Hello, Border!";
text.SetResourceReference(ContentControl.ForegroundProperty, SystemColors.WindowTextBrushKey);
MyBorder.Child = text;

diagram.Background = Brushes.White;
TextBlock text2 = new TextBlock();
text2.Text = "Hello, Diagram!";
text2.SetResourceReference(ContentControl.ForegroundProperty, SystemColors.WindowTextBrushKey);
diagram.Nodes.Add(text2);

DiagramNodeAdapter adapter = (DiagramNodeAdapter) Diagram.GetDiagramItem(text2);
adapter.Bounds = new Rect(100, 100, 100, 100);
}
}
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DynamicResources do not work
Reply #1 - Apr 23rd, 2008 at 1:12pm
Print Post  
It didn't work in our test too, but we don't know why. Our developer will try to find out more in the next few days.

Stoyan
  
Back to top
 
IP Logged
 
Todd
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 15th, 2008
Re: DynamicResources do not work
Reply #2 - Apr 29th, 2008 at 12:40am
Print Post  
Stoyo,

I was wondering if any progress has been made on this issue? Is there a possible workaround until you are able to fix this issue?

-Todd
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DynamicResources do not work
Reply #3 - Apr 29th, 2008 at 9:42am
Print Post  
We are working on it. Hopefully, the fix will be available this week.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint