2013-08-23 34 views
-1

我有一個Windows Phone 8應用程序,我想在其中顯示標題和說明。我的描述非常大,所以我想首先顯示一些字符,並閱讀更多按鈕,然後當用戶單擊該按鈕時,他將能夠看到剩餘的描述。我如何實現這一點,以及在Window Phone 8中創建多讀按鈕的準則是什麼?Windows Phone 8中有一個「閱讀更多」按鈕

public class MyClass : INotifyPropertyChanged { 
    private string _shortText; 
    private string _fullText; 
    private bool _showFullText; 

    public string Text { 
    get 
    { 
     if (_showFullText) 
     return _fullText; 
     else 
     return _shortText; 
    } 
    } 
    public void Switch() { 
    _showFullText = !_showFullText; 
    OnPropertyChanged("Text"); 
    } 
} 

然後你把TextWrapping的TextBlock爲{文本裝訂}以及您撥打一個帶下劃線的TextBlock:我怎樣才能在Windows Phone的實現這一8.

回答

1

你可以通過切換說明文字實現這一目標在Tap事件中切換方法。