Following .aspx page:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Vowels.aspx.cs" Inherits="XMLPraktijkOpdrachtJavascript.Vowels" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Vowels</title>
<script type="text/javascript" src="Javascript/Vowels.js"></script>
</head>
<body>
<object id="VowelsPage" width="100%" height="100%" type="application/x-silverlight">
<param name="source" value="Xaml/Vowels.xaml"/>
</object>
</body>
</html>
Uses this xaml file:
http://pastebin.com/1sFX93Bp (it's a bit long to post here)
But my page simply won't load. It says white. If I comment out everything from line 20 however, it does work (ie: the remaining code executes).
What could be the problem, or are there any decent Xaml debuggers out there? Since Visual Studio won't let you put breakpoints in xaml files.
can you please change this
TargetType="{x:Type TextBlock}"
to
TargetType="TextBlock"
and also you need to remove
<Setter Property="Background" Value="#FF3B596E"/>
<Setter Property="Background" Value="#FF3B5940"/>
and change
<Setter Property="FontSize" Value="24px"/>
<Setter Property="FontSize" Value="14px"/>
<Setter Property="FontSize" Value="14px"/>
to
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontSize" Value="14"/>
The complete xaml script is shown as below,
<?xml version="1.0" encoding="UTF-8"?>
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="OnLoaded">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="600"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.Background>
<LinearGradientBrush>
<GradientStop Color="Red"/>
<GradientStop Color="#FF3B596E" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.Resources>
<Style x:Key="TitleText"
TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe Black"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="Foreground" Value="MidnightBlue"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="LabelText"
TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe Black"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#FFB3B4C1"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="ValueText"
TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe Black"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="Ivory"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</Grid.Resources>
<Grid.Background>
<LinearGradientBrush>
<GradientStop Color="#93C5E8"/>
<GradientStop Color="#3B596E" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.ColumnSpan="6" Style="{StaticResource TitleText}">
Vowel Details
</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1" Style="{StaticResource LabelText}">Strings with frequency > 50</TextBlock>
<Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Content="Sort"
Grid.Column="0"
Grid.Row="4"
Name="btnSort50"/>
<TextBlock Grid.Column="1" Grid.Row="1" Style="{StaticResource ValueText}">128</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="1" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="1" Style="{StaticResource ValueText}">51</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="2" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="2" Style="{StaticResource ValueText}">12</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="3" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="3" Style="{StaticResource ValueText}">22</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="4" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="4" Style="{StaticResource ValueText}">7</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="5" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="5" Style="{StaticResource ValueText}">7</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="6" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="6" Style="{StaticResource ValueText}">3</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="1" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="1" Style="{StaticResource ValueText}">52</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="2" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="2" Style="{StaticResource ValueText}">7</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="3" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="3" Style="{StaticResource ValueText}">27</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="4" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="4" Style="{StaticResource ValueText}">5</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="5" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="5" Style="{StaticResource ValueText}">9</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="6" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="6" Style="{StaticResource ValueText}">4</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="7" Style="{StaticResource LabelText}">Strings with frequency > 40</TextBlock>
<Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Content="Sort"
Grid.Column="0"
Grid.Row="10"
Name="btnSort40"/>
<TextBlock Grid.Column="1" Grid.Row="7" Style="{StaticResource ValueText}">182</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="7" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="7" Style="{StaticResource ValueText}">78</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="8" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="8" Style="{StaticResource ValueText}">15</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="9" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="9" Style="{StaticResource ValueText}">36</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="10" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="10" Style="{StaticResource ValueText}">13</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="11" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="11" Style="{StaticResource ValueText}">10</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="12" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="12" Style="{StaticResource ValueText}">4</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="7" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="7" Style="{StaticResource ValueText}">75</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="8" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="8" Style="{StaticResource ValueText}">14</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="9" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="9" Style="{StaticResource ValueText}">38</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="10" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="10" Style="{StaticResource ValueText}">8</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="11" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="11" Style="{StaticResource ValueText}">10</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="12" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="12" Style="{StaticResource ValueText}">5</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="13" Style="{StaticResource LabelText}">Strings with frequency > 30</TextBlock>
<Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Content="Sort"
Grid.Column="0"
Grid.Row="16"
Name="btnSort30"/>
<TextBlock Grid.Column="1" Grid.Row="13" Style="{StaticResource ValueText}">247</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="13" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="13" Style="{StaticResource ValueText}">100</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="14" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="14" Style="{StaticResource ValueText}">18</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="15" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="15" Style="{StaticResource ValueText}">48</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="16" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="16" Style="{StaticResource ValueText}">19</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="17" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="17" Style="{StaticResource ValueText}">11</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="18" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="18" Style="{StaticResource ValueText}">4</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="13" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="13" Style="{StaticResource ValueText}">103</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="14" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="14" Style="{StaticResource ValueText}">19</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="15" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="15" Style="{StaticResource ValueText}">55</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="16" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="16" Style="{StaticResource ValueText}">10</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="17" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="17" Style="{StaticResource ValueText}">13</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="18" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="18" Style="{StaticResource ValueText}">6</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="19" Style="{StaticResource LabelText}">Strings with frequency > 20</TextBlock>
<Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
Content="Sort"
Grid.Column="0"
Grid.Row="22"
Name="btnSort20"/>
<TextBlock Grid.Column="1" Grid.Row="19" Style="{StaticResource ValueText}">392</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="19" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="19" Style="{StaticResource ValueText}">170</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="20" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="20" Style="{StaticResource ValueText}">34</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="21" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="21" Style="{StaticResource ValueText}">77</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="22" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="22" Style="{StaticResource ValueText}">29</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="23" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="23" Style="{StaticResource ValueText}">21</TextBlock>
<TextBlock Grid.Column="2" Grid.Row="24" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="3" Grid.Row="24" Style="{StaticResource ValueText}">9</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="19" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="19" Style="{StaticResource ValueText}">161</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="20" Style="{StaticResource LabelText}">a</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="20" Style="{StaticResource ValueText}">27</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="21" Style="{StaticResource LabelText}">e</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="21" Style="{StaticResource ValueText}">81</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="22" Style="{StaticResource LabelText}">i</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="22" Style="{StaticResource ValueText}">24</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="23" Style="{StaticResource LabelText}">o</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="23" Style="{StaticResource ValueText}">20</TextBlock>
<TextBlock Grid.Column="4" Grid.Row="24" Style="{StaticResource LabelText}">u</TextBlock>
<TextBlock Grid.Column="5" Grid.Row="24" Style="{StaticResource ValueText}">9</TextBlock>
</Grid>
</Grid>
Related
It would be great if someone could help me. I currently have a phone page and I would like to display the images, but somehow my scrollviewer doesnt scroll to the bottom I can only see two rows of Images and after that the scrollviewer doesn't go any further.
Here is my XAML:
<ScrollViewer x:Name="Details">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Rectangle Fill="Black" Opacity="0.5" Grid.ColumnSpan="2" Grid.RowSpan="8"/>
<StackPanel Margin="15,10,1,0" Grid.Column="0" Grid.Row="0">
<TextBlock Text="{Binding xxx.Address}" Foreground="White" FontSize="22" FontWeight="Bold" />
<TextBlock Foreground="White">
<Run Text="{Binding xxx.Zipcode}" />
<Run />
<Run Text="{Binding xxx.Location}" />
</TextBlock>
</StackPanel>
<Image Source="/Assets/xxx.png" Height="50" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0" />
<StackPanel Grid.Row="2">
<TextBlock Text="{Binding xxxx.xxx}" Foreground="White" MinHeight="50" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" Margin="15,10,1,0" FontSize="22" />
<TextBlock Text="xxxx" Foreground="White" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="15,0,1,10" />
</StackPanel>
<Image Source="/Assets/xxx.png" Grid.Row="2" Grid.Column="1" Height="50" Margin="10" />
<TextBlock Text="xxx:" Margin="15,10,1,0" Foreground="#FFD8051E" Grid.Column="0" Grid.Row="3"/>
<TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="4" />
<TextBlock Margin="15,10,1,0" Grid.Column="1" Grid.Row="4" >
<Run Text="{Binding xxx}" />
<Run Text=" m" />
</TextBlock>
<TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="5" />
<TextBlock Text="{Binding xxxx}" Margin="15,10,1,0" Grid.Column="1" Grid.Row="5" />
<TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="6" />
<ItemsControl Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="7" ItemsSource="{Binding xxxx}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<tool:WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Image Margin="10" Source="{Binding .,Converter={StaticResource xxxxx}}" Height="100" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
I think the problem is in your ScrollViewer Properties.
there should be some more definition
<ScrollViewer Grid.Row="1"
Name="Details"
VerticalScrollBarVisibility="Visible" AllowDrop="False" ManipulationMode="Control">
I am not able to make the scrollviewer working! The list is not scrollable. Maybe you can help me :)
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer Margin="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel VerticalAlignment="Top">
<ListBox x:Name="KommentareListView" ItemsSource="{Binding}" Foreground="White" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Background="#FF0083FF" Width="10" />
<StackPanel Margin="10,5,10,5" Grid.Column="1">
<TextBlock Text="{Binding Kommentar}"
FontSize="16" Margin="0,0,0,0" TextWrapping="Wrap" Foreground="Black"/>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="{Binding Author}"
FontSize="12" Margin="0,0,0,0" Foreground="Black"/>
<TextBlock Text="{Binding Date}"
FontSize="12" Margin="30,0,0,0" Foreground="Black"/>
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button x:Name="mehrKommentareLaden" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10,0,0" Height="45" Visibility="Collapsed" Content="mehr Kommentare laden" Click="mehrKommentareLaden_Click" />
</StackPanel>
</ScrollViewer>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Row="1">
<StackPanel x:Name="AnmeldenPanel" VerticalAlignment="Bottom" Width="456" Visibility="Collapsed">
<Button x:Name="AnmeldenButton" Content="Anmelden" VerticalAlignment="Center" BorderBrush="Black" Foreground="Black" Margin="0" Click="AnmeldenButton_Click"/>
<TextBlock TextWrapping="Wrap" Text="Du musst dich anmelden, um Kommentare zu verfassen." Margin="15,0,0,0"/>
</StackPanel>
<toolkit:PhoneTextBox x:Name="KommentarBox" Hint="Dein Kommentar..." LengthIndicatorVisible="True" LengthIndicatorThreshold="10" DisplayedMaxLength="240" TextWrapping="Wrap" Background="#BFB2B2B2" BorderBrush="#BFFFFFFF" Foreground="#91000000" SelectionBackground="#FF0083FF" SelectionForeground="White" Style="{StaticResource PhoneTextBoxWhiteBackground}" Height="74" Width="456"/>
</StackPanel>
<!--<Controls:WatermarkTextBox x:Name="KommentarTextBox" Margin="0,0,100,20" TextWrapping="Wrap" Watermark="Dein Kommentar...." Height="30" VerticalAlignment="Center" FontFamily="Calibri" FontSize="17.333" BorderBrush="#CC000000"/>-->
</Grid>
Try making the List height to auto and everything else to auto which is in between List and ScrollView like you are having StackPanel.
I Have Used ItemsControl and added this in wrappanel.
<toolkit:WrapPanel Height="Auto" Width="Auto" Orientation="Horizontal" >
<ItemsControl ItemsSource="{Binding ParcelViewModel.FavoriteParcelImages}" Height="Auto" Width="Auto" >
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel Grid.Column="2" Grid.Row="1" Grid.RowSpan="3" Height="Auto" Width="Auto" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" BorderBrush="LightGray" Margin="3" Height="Auto" Width="200" >
<StackPanel Orientation="Horizontal" Width="200">
<Grid Width="200">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Height="100" HorizontalAlignment="Left">
<!--<Image Source="/PropMgmt;component/Assets/Images/office-building-icon.png" Margin="0,5,0,0" Width="50" Height="50" />-->
<Image Source="{Binding DisplayImage.Source}" Height="50" Width="50"></Image>
<StackPanel Margin="15,0,0,0">
<StackPanel Orientation="Horizontal">
<Image Source="/PropMgmt;component/Assets/Images/circle_orange.png" Width="10" />
<TextBlock Text="{Binding ReservedCount}" Margin="5,0,0,0"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Image Source="/PropMgmt;component/Assets/Images/circle_green.png" Width="10" />
<TextBlock Text="{Binding VaccantCount}" Margin="5,0,0,0"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Image Source="/PropMgmt;component/Assets/Images/circle_red.png" Width="10" />
<TextBlock Text="{Binding LeasedCount}" Margin="5,0,0,0"></TextBlock>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Text="Code:" FontWeight="Bold"></TextBlock>
<TextBlock Text="{Binding Code}"></TextBlock>
<TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
<TextBlock Text="{Binding Title}"></TextBlock>
**<HyperlinkButton Content="{Binding Title}" Command="{Binding GetUnitListForParcel}" ></HyperlinkButton>**
<TextBlock Text="Year of Construction:" FontWeight="Bold"></TextBlock>
<TextBlock Text="{Binding Year_Of_Construction}"></TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</toolkit:WrapPanel>
Added Hyperlink Button Inside DataTemplate. But I Didnt Understand Why Command On HyperlinkButton Is Not working??
Please Help..
you need to change your binding:
<HyperlinkButton Content="{Binding Title}" Command="{Binding YourViewModelName.GetUnitListForParcel, Source={StaticResource Locator}}" />
I have the following GridView
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemsGridView"
AutomationProperties.Name="Items"
TabIndex="1"
Grid.RowSpan="2"
Padding="116,136,116,46"
SelectionMode="Single"
IsSwipeEnabled="false"
Visibility="Collapsed">
<GridView.ItemTemplate>
<DataTemplate>
<!--<Border BorderBrush="DarkSeaGreen" BorderThickness="1">-->
<Grid Background="{Binding objBackgroundColor}" Opacity="1" Width="400" Height="80">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBlock Text="{Binding objCustomTestPaper.Name}" TextWrapping="Wrap" FontWeight="SemiBold" VerticalAlignment="Top" Foreground="{Binding objForegroundColor}" Style="{StaticResource TitleTextStyle}" FontSize="20" MaxHeight="25" Margin="10,5,10,0" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Height="35" VerticalAlignment="Center" HorizontalAlignment="Center" Source="Assets/paper.png"></Image>-->
<StackPanel Grid.Column="0" Margin="5,7,0,0">
<callisto:Rating FontStretch="SemiCondensed" ItemCount="5" Value="{Binding objCustomTestPaper.TestRating}" FontWeight="Light" VerticalAlignment="Bottom" Margin="0,2,5,1" Background="Transparent" HorizontalAlignment="Left" Foreground="{Binding objForegroundColor}" IsHitTestVisible="False" FontSize="12" >
</callisto:Rating>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="Attempted by others:" Margin="4,0,0,0" FontSize="12" FontWeight="Light" Foreground="{Binding objForegroundColor}"></TextBlock>
<TextBlock Text="{Binding objCustomTestPaper.AttemptCount}" FontWeight="SemiBold" Margin="5,0,0,0" FontSize="12" Foreground="{Binding objForegroundColor}"></TextBlock>
<TextBlock Text="times" Margin="3,0,0,0" FontSize="12" FontWeight="Light" Foreground="{Binding objForegroundColor}"></TextBlock>
</StackPanel>
</StackPanel>
<StackPanel VerticalAlignment="Stretch" Grid.Column="2" Margin="0,0,0,0" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="Time:" FontSize="16" Foreground="{Binding objForegroundColor}" VerticalAlignment="Bottom" FontWeight="SemiLight"></TextBlock>
<TextBlock Text="{Binding strTestDuration}" Margin="5,0,0,0" FontSize="18" VerticalAlignment="Bottom" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
</StackPanel>
<StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="Points:" FontSize="16" Margin="0,0,0,0" VerticalAlignment="Bottom" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
<TextBlock Text="{Binding objCustomTestPaper.TotalMarks}" Margin="5,0,0,0" VerticalAlignment="Bottom" FontSize="18" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
It is working fine and loads data successfully but When I press back button the data remains in the memory (not usable) and keeps on increasing at various visits to the page. I don't know how how to clear the items of the GridView when OnNavigationFrom(,) method is called. I am trying to use objGridView.Items.Clear() but it throws some HRXXXX exception.
I have the followin
g code
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemsGridView"
AutomationProperties.Name="Items"
TabIndex="1"
Grid.RowSpan="2"
Padding="116,136,116,46"
SelectionMode="Single"
IsSwipeEnabled="false"
Visibility="Collapsed">
<GridView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="DarkSeaGreen" BorderThickness="1">
<StackPanel HorizontalAlignment="Left" Width="250" Height="180" Background="SeaGreen">
<StackPanel VerticalAlignment="Top" >
<TextBlock Text="{Binding Name}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" TextWrapping="Wrap" MinHeight="40" FontSize="22" Margin="15,10,15,0"/>
</StackPanel>
<Grid Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="TotalMarks:" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,0,0"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding TotalMarks}" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="Total Questions:" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,0,0" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding TotalQuestions}" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="Total attempts:" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,0,0" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding AttemptCount}" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="Ratings:" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,0,0" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding TestRating}" Foreground="White" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" />
<!-- Here I want to add -->
</Grid>
</StackPanel>
</Border>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
I want to add a rating control in the grid in the data template so that its value can be bound with an integer variableTestRating. As I am new to databinding I don't how to do this. Please provide some assistance.
Thanks in advance.
It probably depends on the Rating control you are using. Here's how you would do it with Callisto's:
<callisto:Rating ItemCount="5" Value="{Binding TestRating}" />
Assuming the binding works for the TextBlock immediately above the spot where you want to insert ratings, this should work as well.
To facilitate any changes to be reflected in your source, you would need to make the binding two-way for the changes that are made in the control to be bound back to the source. So the appropriate change would be:
<callisto:Rating ItemCount="5" Value="{Binding TestRating, Mode=TwoWay}" />