2013-02-11 70 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

相關問題