2013-02-11 72 views
0

我有一个模板/模式,我得到了http://gallery.expression.microsoft.com/(模拟扫描时钟 - http://gallery.expression.microsoft.com/AnalogSweepingClock),我想用我的WPF应用程序使用Microsoft Expression Blend 4.可能吗?我使用WPF的目的是允许你有更多的窗口。如何在Microsoft Expression Expression 4中的WPF应用程序中使用silverlight?

我试着在我的WPF应用程序中添加模拟类的.xaml和.cs。但它只显示时钟本身,但钟针不起作用。

你能帮我解决吗?

回答

1

时钟指针不会在设计模式下移动。您需要构建并运行项目才能看到它们移动。

拿到项目建设,我不得不从线106,107,118,135,140,145和150

你可能会发现另一个问题的元素去掉UseLayoutRounding="False"属性是WPF没有按似乎没有拿起属性更改事件的CurrentDayCurrentMonth属性。最简单的选择是将它们更改为依赖属性:

public static readonly DependencyProperty CurrentMonthProperty 
    = DependencyProperty.Register("CurrentMonth", 
    typeof(string), typeof(AnalogSweepingClock), 
    new PropertyMetadata(null)); 

public string CurrentMonth 
{ 
    get { return (string)GetValue(CurrentMonthProperty); } 
    set { SetValue(CurrentMonthProperty, value); } 
} 

public static readonly DependencyProperty CurrentDayProperty 
    = DependencyProperty.Register("CurrentDay", 
    typeof(string), typeof(AnalogSweepingClock), 
    new PropertyMetadata(null)); 

public string CurrentDay 
{ 
    get { return (string)GetValue(CurrentDayProperty); } 
    set { SetValue(CurrentDayProperty, value); } 
} 
+0

谢谢。我可以问问你是否可以使用Silverlight应用程序到wpf应用程序? – MMakati 2013-02-12 09:33:27

+0

@ user2061539:不确定你的意思 - 我只是将'UserControl'添加到新的WPF应用程序中,修复了编译器错误('UseLayoutRounding'属性),然后修复了月/日更新问题。 – 2013-02-12 12:20:34

+0

UserControl意味着您只会添加.xaml和.xaml.cs?我只是将其添加到项目的参考。 – MMakati 2013-02-12 14:43:17

相关问题