7
A
cevap
3
MSDN'teki belgelere dayanarak bu işlevsellik (ör. Binding class'daki StringFormat
) WinRT'de bulunmamaktadır.
Yani ViewModel size Products
koleksiyonunda değişiklikleri izlemek ve ProductsText
mülkiyet değişti bildirmek için kanca
public class MyViewModel
{
public IList<Product> Products { get; set; }
public string ProductsText
{
get
{
return string.Format("{0} Products", Products.Count);
}
}
}
Not üzerinde biçimlendirme yapmak. biçimlendirilmiş mülke
Ve bağlama:
<TextBlock Text="{Binding ProductsText}" />
8
Bunu kullanabilirsiniz:
<TextBlock>
<Run Text="{Binding Path=Products.Count}" />
<Run Text=" Products" />
</TextBlock>
İlgili konular
- 1. TextBlock <Run> aralık
- 2. Git, <<<<<<< HEAD dosyasına
- 3. Nedir? ve << demek?
- 4. <: <İş nasıl?
- 5. İçindeki eleman sayısı <5 in <a1 <0</ a1><T>
- 6. <nedir? ve <? php
- 7. WPF DatePicker başarıyla veritabanı veya bir özelliğinden tarihi gösterir bir <code>DataGrid</code> bir <code>DatePicker</code> nesne var
- 8. <a1> Text</ a1> temizleniyor null
- 9. Java, bitshifts kullanırken, neden 1 << 32! = 1 << 31 << 1?
- 10. Haritaya <Eşleme <String, Dize>
- 11. EJS: <% = versus <% -
- 12. Groovy:</p> İşte <pre><code>param = args[0] println(param) </code></pre> <p>bunu çalıştırmak nasıl (Windows 7):</p> <pre><code>groovy test.groovy a&b </code></pre> <p>beklediğim bu senaryo bir & b yazdırır
- 13. "<%:" ne yapıyor?</p> <pre><code><%: Model.FirstName %> </code></pre> <p>"<%:" Ne vermez: do
- 14. asp.net <%$ ... %> sözdizimi
- 15. Bu garip koşullu operatör sözdizimi nedir?</p> <pre><code>bool bRes = (a < b) ? a=b, true : false; </code></pre> <p><code>a < b</code>, o zaman <code>a=b</code> infaz ve <code>bRes</code> doğrudur edilir:
- 16. Şu izle ifadem tutan bana gösteriyor Şu anda bir</p> <pre><code>Expression<Func<T,bool>> </code></pre> <p>bir</p> <pre><code>Expression<Func<T,object>> </code></pre> <p>dönüştürmek çalışıyorum
- 17. REGEX: <code><%=anything%><%=anything%></code></p> <p>ve normal bir ifade: <code><%=\\s*(\\S+)\\s*%></code> bu açıklama ı bildirimde bulunmamış REGEX
- 18. Thymeleaf'ın JSP etiketleri gibi bir şeyleri var mı?</p> <p><strong><em>ChildPage.jsp</em></strong>:
- 19. Kanal seç <- <- Kanal
- 20. Perl'de "% _" nedir?</p> <pre><code>@list = grep { !$_{$_}++ } @list; </code></pre> <p>tekilleştirme için bir deyim gibi:
- 21. Bu komut dosyası etiketi nedir?</p> <pre><code><script src="{{ file.name_js }}"></script> </code></pre> <p>bu mu daha iyi:
- 22. <text> içeriğinin düzeltilmesi
- 23. <section>, <nav> ve <article>
- 24. Sözlük <> bir IEnumerable <> kaynağı ile doldurma</ a0><a1></ a1>
- 25. Bayt değerlerini karşılaştırın? ... does</p> <pre><code>boolean match = (data[0] == 0xFE); </code></pre> <p>... ederken
- 26. Objective-C'de özel yönergeler oluşturmak mümkün mü?</p> <ul> <li>@interface</li> <li>@implementation</li> <li>@end</li> <li>@protocol bence</li> <li>@property</li> <li>@synthesize</li> </ul> <p>:
- 27. BOOST_CHECK_NO_THROW ben</p> <pre><code>BOOST_CHECK_NO_THROW(method_to_test()); </code></pre> <p>kullanarak bir yöntemi sınamak
- 28. Bu tür bir ismin adı nedir?</p> <p><a href="http://www.json.org/object.gif" rel="noreferrer">http://www.json.org/object.gif http://www.json.org/object.gif</a></p> <p>böyle gösterimde adı nedir:
- 29. UTF-8 hatası: "<>" Gmail "in <>" INBOX "<95><95> kimliğinden <> yapamazsınız <>.
- 30. $ rootScope değişkenini nasıl yazdırabilirim?</p> <pre><code><td><img src="{{$rootScope.s3BucketUrl}}"/></td> </code></pre> <p>ve bu onu tanımlanan nerede:
Yoksa 'IValueConverter' yazmak veya' ContentControl' kullanmak ve birden yerlerinden metin inşa edebilirsiniz, ve sanırım birden çok yol var, ama bunu viewmodel'de yapmanızı şiddetle tavsiye ediyorum. Viewmodels bunun için kast edildiğinden. – nemesv
Mükemmel - teşekkürler! –