Saturday 15 September 2012

wpf - Bind a row of a grid to switch between a gridview and text -


Is

On the main page of my app, a grid with two rows have I first row heading etc. The second line is a gridview of a bunch of data.

I would like to pair the second line of my main grid in a boolean or something, checking whether a user is logged in or not.

If the user is not logged in, you will display the second row only text: "Please Log"

If the user is logged in, then populate Gridwu with data < P> Now, my code is only done with a CollectionViewSource data as

  & lt; CollectionViewSource x :. Name = "GroupedItemsViewSource" source = "{Binding data}" IsSourceGrouped = "true" ItemsPath = "information" D: Source = "{Binding Data Source = {d: DesignInstance IsDesignTimeCreatable = true, type = Local: HomeDesignData}}" />   

then the grid from two rows, and gridview in the first line

   & Lt; Roadfinion height = "*" /> & Lt; /Grid.RowDefinitions> & Lt; GridView x: Name = "itemGridView" AutomationProperties.AutomationId = "ItemGridView" AutomationProperties.Name = "group items" Grid.RowSpan = "2" padding = "116,137,40,46" ItemsSource = "{Binding Source = {StaticResource groupedItemsViewSource} } "ItemTemplate =" {StaticResource Standard500x130ItemTemplate} "SelectionMode =" none "IsSwipeEnabled =" false "IsItemClickEnabled =" right "ItemClick =" ItemView_ItemClick "& gt;   

By the way, I've just been forced to Gridwu wants to find a way to fully carry out simple text speak, these bullion or log of a user or No

Thanks in advance for any input

A lot to complete it Easy way GridView also appears and will take advantage of a BooleanToVisibilityValueConverter for this if this user is not logged in.

  & Lt; Grid style = "{StaticResource LayoutRootStyle}" & gt; & Lt; Grid.Resources & gt; & Lt; Converters: BooleanTovidability Converter x: key = "butttowice" /> & Lt; /Grid.Resources> & Lt; Grid.RowDefinitions & gt; & Lt; Roadfinish height = "140" /> & Lt; Roadfinion height = "*" /> & Lt; /Grid.RowDefinitions> & Lt; GridView x: name = "item grid view" grid. Line = "2" ... /> & Lt; Grid grid. Rau = "2" background = "black" visibility = "{binding islaggin, converter = {static resource balltosis}}" & gt; & Lt ;! - Grid control will fill the full line & lt; TextBlock Text = "Log in to Dummy!" / & Gt; & Lt; / Grid & gt; & Lt; / Grid & gt;    

No comments:

Post a Comment