मेट्रो शैली विंडोज 8 एप्लिकेशन में, मैं इस तरह के xaml का उपयोग कर डेटा कैसे प्रदर्शित कर सकता हूं (https://dl.dropbox.com/u/59251888/img.png) छवि। क्या ListBox, ListView, GrdView .. का उपयोग करना संभव है?पंक्तियों और स्तंभों में डेटा कैसे प्रदर्शित करें XAML विंडोज 8
5
A
उत्तर
5
हां, लेकिन आपको इसे स्टाइल करने की आवश्यकता है ताकि यह डेटाग्रिड जैसा दिखता हो। (मान लीजिए कि आप इस प्रश्न को सौंपे गए टैग के आधार पर एक्सएएमएल में विकास कर रहे हैं)। चाल एक डेटा टेम्पलेट बनाना है जो उचित चौड़ाई, संरेखण इत्यादि के साथ कॉलम के साथ ग्रिड का उपयोग करता है
मैंने कुछ सूची बनाई है - एक सूची दृश्य का उपयोग करके। यह पृष्ठभूमि को पंक्तियों के विपरीत केवल कोशिकाओं के लिए दिखाई देने के लिए संशोधित किया जा सकता है - जो मैंने किया है। आशा है कि इस मदद करता है:
XAML:
<ListView
VerticalAlignment="Top"
Margin="0,5"
ItemsSource="{Binding HighestExpensesAlternatingList}"
ItemTemplate="{StaticResource HighestExpensesTemplate}"
BorderBrush="#19FFFFFF" BorderThickness="1,0,0,0"
SelectionMode="None" IsItemClickEnabled="False"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ItemContainerStyle="{StaticResource SimpleListViewItemStyle}"
IsHitTestVisible="False"/>
<DataTemplate x:Key="HighestExpensesTemplate">
<Grid Width="500" VerticalAlignment="Center" Margin="5,0"
Background="{Binding AlternatingIndexBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="5" TextWrapping="NoWrap"
Style="{StaticResource BasicTextStyle}"
VerticalAlignment="Center"
Text="{Binding Item.DateString}" />
<TextBlock Grid.Column="1" Margin="5" TextWrapping="NoWrap"
Style="{StaticResource BasicTextStyle}"
VerticalAlignment="Center"
Text="{Binding Item.Description}" />
<TextBlock Grid.Column="2" Margin="5" TextWrapping="NoWrap"
Style="{StaticResource BasicTextStyle}"
VerticalAlignment="Center"
Text="{Binding Item.AmountStringCurrencyFormat}"
HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
<Style x:Key="SimpleListViewItemStyle" TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TabNavigation" Value="Local"/>
<Setter Property="IsHoldingEnabled" Value="False"/>
<Setter Property="IsDoubleTapEnabled" Value="False"/>
<Setter Property="IsRightTapEnabled" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Margin="{TemplateBinding Margin}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Pressed">
<Storyboard>
<PointerDownThemeAnimation TargetName="Container"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="Container">
<ContentPresenter x:Name="contentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
संबंधित मुद्दे
- 1. स्तंभों में पिवट पंक्तियों
- 2. स्तंभों में पंक्तियों (कस्टम पिवट)
- 3. T-SQL - पंक्तियों और स्तंभों
- 4. विंडोज 8/XAML डबल टैप, हमेशा नल
- 5. सी #/WPF: टूलकिट डेटा ग्रिड - स्थानांतरित पंक्तियों और स्तंभों
- 6. WinRT XAML में DesignTime डेटा कैसे करें?
- 7. विभिन्न पंक्तियों और स्तंभों पर घटाव और समूह
- 8. विंडोज 8 और विंडोज फोन 8
- 9. जोड़ना स्तंभों और पंक्तियों में एक TableLayoutPanel पंक्ति गतिशील
- 10. नाम का नाम नामस्थान YYY (XAML VS12 विंडोज 8)
- 11. किसी HTML तालिका की पंक्तियों और स्तंभों को कैसे घुमाएं (ट्रांसपोज़ करें)?
- 12. विंडोज 8 में संपर्कों को कैसे एक्सेस और संशोधित करें?
- 13. सी # विंडोज फोन- xaml ListBox.ItemTemplate
- 14. विंडोज 8
- 15. विंडोज स्टोर ऐप्स में एक संदेश कैसे प्रदर्शित करें?
- 16. विंडोज 8 -
- 17. Windows 8 में नियंत्रण की ऊंचाई चेतन कैसे XAML
- 18. विंडोज 8 मेट्रो ऐप
- 19. विंडोज 8 - सी #
- 20. ListBox मार्जिन विंडोज 7 और विंडोज 8
- 21. विंडोज 8 वेबव्यूज़ में ज़ूम को अक्षम कैसे करें
- 22. विंडोज 8
- 23. विंडोज 8 में एमएलएएमएल
- 24. विंडोज 8
- 25. विंडोज 8
- 26. विंडोज 8
- 27. विंडोज 8 मेट्रो ऐप
- 28. Windows 8 मेट्रो क्षुधा (सी #/XAML)
- 29. विंडोज 8
- 30. एचटीएमएल टेबल - पंक्तियों या स्तंभों द्वारा
आपके उत्तर के लिए धन्यवाद। असल में आपने अलग-अलग कॉलम में अलग-अलग विशेषताओं के साथ प्रति पंक्ति एक आइटम दिखाया है, मैं प्रति पंक्ति 3 आइटम, प्रत्येक आइटम को एक अलग कॉलम में दिखाना चाहता हूं .. क्या कोई विचार मैं यह कर सकता हूं ..? – Ishti
मुझे लगता है कि आप अपने आइटमपैनल सेट के साथ एक ग्रिड व्यू का उपयोग संपत्ति ओरिएंटेशन = "क्षैतिज" और अधिकतम पंक्तियों के कॉलम = "3" के साथ एक रैपग्रिड पर सेट कर सकते हैं। फिर आप इसे अलग पंक्तियों और स्तंभों की तरह दिखने के लिए शैली देंगे। – Krishna
धन्यवाद कृष्ण, मैंने आपके जैसा उल्लेख किया है, मैंने व्रपग्रिड का उपयोग किया, और यह वैसे ही काम करता था जैसा मैं चाहता था .. धन्यवाद – Ishti