I'm using Prism. I have a ContextControl region, and a view associated with that region. Within the view is a TabControl. The controls are displaying data with no problem, but the controls within the TabControl are not displaying any data. I have tried setting the DataContext and ItemsSource(for the TabControl) , without success. The data to be displayed is from the SelectedSession class.
xaml
<!--session data grid-->
<Grid x:Name="SessionDataGrid"
Grid.Column="2"
Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentControl
Grid.Row="0"
Margin="0 0 0 0"
prism:RegionManager.RegionName="DataRegion"/>
</Grid>
View
<!--row 0-->
<Label x:Name="labelSessionData"
Content="Session Data"
Style="{DynamicResource LabelGeneric}"
Grid.Column="0"
Grid.Row="0"
HorizontalContentAlignment="Center"
Margin="1,2,0,0"/>
<!--row 1-->
<Label x:Name="labelSessionDataIdentifier"
Content="Identifier: "
Grid.Column="0"
Grid.Row="1"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Right"
Style="{DynamicResource LabelGeneric}"/>
<TextBox x:Name="textBoxSessionDataIdentifier"
Grid.Column="1"
Grid.Row="1"
HorizontalAlignment="Left"
Style="{DynamicResource textBoxDataN}"
Text="{Binding SelectedSession.Identifier, Mode=OneWay}"
Width="230"
Margin="0 4 0 3"/>
<Label x:Name="labelSessionDataCamera"
Content="Camera: "
Grid.Column="2"
Grid.Row="1"
HorizontalAlignment="Right"
HorizontalContentAlignment="Right"
Style="{DynamicResource LabelGeneric}"/>
<ComboBox x:Name="comboboxSessionDataCamera"
Grid.Column="3"
Grid.Row="1"
FlowDirection="LeftToRight"
HorizontalAlignment="Left"
HorizontalContentAlignment="Left"
IsEditable="True"
ItemsSource="{Binding Cameras}"
DisplayMemberPath="CameraName"
SelectedValue="{Binding SelectedSession.CameraId, Mode=TwoWay}"
SelectedValuePath="CameraId"
Style="{DynamicResource ComboboxData}"
Width="230"
Margin="0 0 0 0"/>
<!--row 3-->
<TabControl x:Name="tabControlSessionData"
Grid.Column="0"
Grid.ColumnSpan="4"
Grid.Row="3"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="0,0,10,0"
Visibility="Hidden">
<TabItem Header="Analog">
<Grid Background="{StaticResource MainBackgroundColor}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="83"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!--row 0-->
<Label x:Name="labelSessionAnalogFilm"
Content="Film: "
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="0"
Style="{DynamicResource LabelGeneric}"
Margin="1,1,0,0"/>
<ComboBox x:Name="comboboxSessionAnalogFilm"
Grid.Column="2"
Grid.ColumnSpan="2"
Grid.Row="0"
ItemsSource="{Binding Films}"
DisplayMemberPath="FilmName"
SelectedValue="{Binding SelectedSession.FilmId, Mode=TwoWay}"
SelectedValuePath="FilmID"
Style="{DynamicResource ComboboxData}"
Margin="0 0 0 0"/>
<Label x:Name="labelSessionAnalogISO"
Content="ISO: "
Grid.Column="4"
Grid.Row="0"
HorizontalAlignment="Right"
HorizontalContentAlignment="Right"
Style="{DynamicResource LabelGeneric}"
Margin="2,1,0,0"/>
<TextBox x:Name="textBoxSessionAnalogFilmISO"
Grid.Column="5"
Grid.Row="0"
HorizontalAlignment="Left"
Style="{DynamicResource textBoxDataN}"
Text="{Binding FilmISO, Mode=TwoWay}"
Width="50"
Margin="0,4"/>
Any help would be appreciated.
I was getting the data from a DataGrid. Once I defined the columns for the data it started working.
I need to realize how to do responsive MediaPlayer like this
And what i have
ScrollViewer prevents the second row from taking up space
This is my XAML code:
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<MediaPlayerElement AreTransportControlsEnabled="True"
Name="player"
PosterSource="{Binding SelectedMedia.Poster, UpdateSourceTrigger=PropertyChanged}"
Source="{Binding SelectedMedia.Video_source}"
Stretch="Uniform"
HorizontalAlignment="Center"
AutoPlay="{Binding IsStreamPlay}"
RelativePanel.Above="AboutGrid">
<MediaPlayerElement.TransportControls>
<controls:CustomMediaTransportControls IsCompact="True"
IsZoomButtonVisible="False"
IsPlaybackRateButtonVisible="False"
IsVolumeEnabled="True"
IsVolumeButtonVisible="True"
IsSeekBarVisible="False"
IsPlaybackRateEnabled="False"
QualityCommand="{Binding SetQualityCommand}"
Qualities="{Binding Qualities, Mode=TwoWay}">
</controls:CustomMediaTransportControls>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>
<Grid x:Name="AboutGrid"
Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="{Binding SelectedMedia.Atr_url}"
Width="85"
Height="113"
Grid.Row="0"
Grid.RowSpan="3"
VerticalAlignment="Top"
Margin="4"
HorizontalAlignment="Left"/>
<Grid Grid.Column="1"
Grid.Row="0"
Grid.RowSpan="4"
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<StackPanel HorizontalAlignment="Left">
<TextBlock FontWeight="SemiBold"
TextWrapping="Wrap"
FontSize="17"
Text="{Binding SelectedMedia.Title}" />
<TextBlock FontWeight="SemiLight"
TextWrapping="Wrap"
Text="{Binding SelectedMedia.Description}"/>
<TextBlock FontWeight="SemiLight">
<Run FontWeight="Normal"
Text="{Binding SelectedMedia.Game_name, UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>
</Grid>
</Grid>
</Grid>
</ScrollViewer >
I think the problem is that ScrollViever does not properly resize its children, what can I do about it?
Grid's proportional self-adaptation has preconditions and needs to be calculated based on the width of the current parent container.
But for the ScrollViewer, you can think of it as an "infinite" inner space, so that the Grid's adaptation will not take effect.
If you want to achieve the effect like Twitch, you can choose to limit the height of the MediaPlayerElement, like this:
xaml
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Background="Black" x:Name="MediaContainer">
<MediaPlayerElement
...
HorizontalAlignment="Center"/>
</Grid>
...
</Grid>
</ScrollViewer>
xaml.cs
public VideoPage()
{
this.InitializeComponent();
this.SizeChanged += Page_SizeChanged;
}
private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
{
double height = e.NewSize.Height;
MediaContainer.Height = height * 0.8;
}
Best regards.
I'm unable to get the Gridsplitter to function with the following example code. The grid splitter does not move or resize the surrounding "Top" and "Buttom" grid rows which are set to fill available space:
<Grid Width="Auto" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Top</TextBlock>
</Grid>
<Grid Grid.Row="1">
<GridSplitter Height="5" HorizontalAlignment="Stretch" ResizeDirection="Rows"/>
</Grid>
<Grid Grid.Row="2">
<TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Bottom</TextBlock>
</Grid>
</Grid>
Edit: As Clemens says, your GridSplitter has to be a direct child of the grid that you want to split. You are putting a new Grid into row 1 of the parent grid when you do:
<Grid Grid.Row="1">
<GridSplitter Height="5" HorizontalAlignment="Stretch" ResizeDirection="Rows"/>
</Grid>
You need to put the splitter directly into the parent grid that you want to split and declare the row in the element tag:
<Grid Width="Auto" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<TextBlock Grid.Row="0" FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Top</TextBlock>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" ResizeDirection="Rows"/>
<TextBlock Grid.Row="2" FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Bottom</TextBlock>
</Grid>
Just remove the Grids that are useless:
<Grid Width="Auto" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Top</TextBlock>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" ResizeDirection="Rows"/>
<TextBlock FontSize="55" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Bottom</TextBlock>
</Grid>
EDIT :
For clarity: the GridSplitter control resizes just elements at its same level in Grid children hierarchy. You can put whatever you want inside the grid, but you have to put the GridSplitter to the same level of the control you want to resize.
You can still do this:
<Grid Width="Auto" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid>
<TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Top</TextBlock>
</Grid>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" ResizeDirection="Rows"/>
<Grid Grid.Row="2">
<TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Bottom</TextBlock>
</Grid>
</Grid>
But the GridSplitter has to be at the same level of the control you want to resize.
I am facing one issue with the WPF popup control.
When we resize the window and move it, PopUp control remains at same position at which it was open previously and does not move with the window.
So what is the solution for this issue.
please provide code snippet for the solution if any. Thanks :)
Xaml code for popup control is as follows:
<Popup x:Name="popNonTopMostPopup" Height="200" Width="220" AllowsTransparency="True" Placement="Right">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<fa:FontAwesome Grid.Column="0" Icon="Play" FontSize="30" HorizontalAlignment="Right" Rotation="180" VerticalAlignment="Top" Margin="0 7 -2 0" />
<Border Grid.Column="1" BorderBrush="LightGray" Background="Black" CornerRadius="5" Height="200" Width="200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button x:Name="btnCustomPopup" Click="btnCustomPopup_Click" HorizontalAlignment="Right" Background="Transparent" Foreground="LightGray" BorderBrush="Transparent" Grid.Row="0">
<StackPanel Margin="0">
<fa:FontAwesome Icon="Close" VerticalAlignment="Center" />
</StackPanel>
</Button>
<Label x:Name="lblName" Grid.Row="1" Foreground="LightGray"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label x:Name="lblDueDate" Foreground="LightGray" Content="Fristdatum: " Grid.Column="0" VerticalAlignment="Bottom" Visibility="Hidden"></Label>
<TextBlock x:Name="txtDueDate" Foreground="LightGray" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Center" Visibility="Hidden"></TextBlock>
</Grid>
<Separator Grid.Row="3"></Separator>
<TextBlock x:Name="txtComments" Foreground="LightGray" TextWrapping="WrapWithOverflow" Grid.Row="4" Margin="10 10 10 10"></TextBlock>
</Grid>
</Border>
</Grid>
</Popup>
We have icons on map on click of which pop up control is displayed.Code for click event is as follows.
void pin_MouseLeftButtonDownForOrder(object sender, MouseButtonEventArgs e)
{
// set the placement target of popup as pin mapicon
popNonTopMostPopup.PlacementTarget = orderIcon;
popNonTopMostPopup.IsOpen = true;
}
At my wits end with trying to get a TabControl and TabItems to fill a NavigationPage/Frame.
I have a MasterPage, with a Frame, that will get swapped out for different Pages, which are comprised of UserControls.
The problem I am having is that the TabControl is cutting off the UserControl and not auto sizing properly. Below is an image and the source for the Pages and Controls.
[Field below Location is cutoff] http://imgur.com/FoDGJyN
MainPage.xaml
<UserControl x:Class="TournamentControls.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-
namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-
namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="800">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Name="topNavi" Orientation="Horizontal" Grid.Row="0">
<TextBlock Name="TournamentsNavi" Text="Tournaments"
MouseLeftButtonUp="TournamentsNavi_MouseLeftButtonUp" Margin="0,0,20,0"/>
<TextBlock Name="DivisonsNavi" Text="Division"
MouseLeftButtonUp="DivisonsNavi_MouseLeftButtonUp" Margin="0,0,20,0"/>
<TextBlock Name="EventsNavi" Text="Events"
MouseLeftButtonUp="EventsNavi_MouseLeftButtonUp" Margin="0,0,20,0"/>
<TextBlock Name="CompetitorsNavi" Text="Competitors"
MouseLeftButtonUp="CompetitorsNavi_MouseLeftButtonUp" Margin="0,0,20,0"/>
<TextBlock Name="MastersNavi" Text="Masters"
MouseLeftButtonUp="MastersNavi_MouseLeftButtonUp" Margin="0,0,20,0"/>
<TextBlock Name="RefereesNavi" Text="Referees"
MouseLeftButtonUp="RefereesNavi_MouseLeftButtonUp"/>
</StackPanel>
<navigation:Frame x:Name="PageContent" Background="#007A0909" Grid.Row="1"
Navigated="PageContent_Navigated" Navigating="PageContent_Navigating">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="/{pageName}"
MappedUri="/Pages/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Grid>
</UserControl>
TournamentsPage.xaml
<navigation:Page x:Class="TournamentControls.Tournaments"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:navigation="clr-
namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:toolkit2="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:cc="clr-namespace:TournamentControls.Controls.Tournaments"
d:DesignWidth="640" d:DesignHeight="480" Title="Tournaments Page">
<Grid x:Name="LayoutRoot" Background="White">
<toolkit2:TabControl>
<toolkit2:TabItem x:Name="CreateTab" Header="Create Tournament">
<cc:TournamentsCreateControl/>
</toolkit2:TabItem>
<toolkit2:TabItem x:Name="ModifyTab" Header="Modify Tournament">
<cc:TournamentsModifyControl/>
</toolkit2:TabItem>
</toolkit2:TabControl>
</Grid>
</navigation:Page>
TournamentsCreateControl.xaml
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Margin="0,4,0,4" Style="{StaticResource TaskGridMenuBarBorderStyle}" Grid.ColumnSpan="2" >
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Style="{StaticResource TaskGridMenuBorderStyle}" Margin="0,0,25,0" Padding="10,0" Grid.ColumnSpan="1" HorizontalAlignment="Left">
<StackPanel x:Name="pnlTaskGridToolbar" Orientation="Horizontal">
<!-- save -->
<Button x:Name="SaveButton" Style="{StaticResource ImageButtonStyle}"
Click="SaveButton_Click" ToolTipService.ToolTip="Save BMC Structure" Margin="0,0,5,0" >
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="../../Resources/Icons/Save.png" Margin="0,0,2,0" />
<TextBlock VerticalAlignment="Center">Save Tournament</TextBlock>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
</Border>
</Grid>
</Border>
<Grid x:Name="ContentGrid" Grid.Row="1" VerticalAlignment="Stretch">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" x:Name="LabelsSP" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,10">
<TextBlock x:Name="TournamentLbl" Text="Tournament Name:" FontWeight="Bold" Margin="0,0,10,0" VerticalAlignment="Center"/>
<TextBox x:Name="TournamentTbx" Width="100" MaxLength="255"/>
</StackPanel>
<StackPanel Grid.Row="1" x:Name="LocationSP" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
<TextBlock x:Name="LocationLbl" Text="Location:" FontWeight="Bold" Margin="60,0,12,0" VerticalAlignment="Center"/>
<TextBox x:Name="LocationTbx" Width="100" MaxLength="255"/>
</StackPanel>
<StackPanel Grid.Row="2" x:Name="DateTimeSP" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
<TextBlock x:Name="DateTimeLbl" Text="Tournament Time:" FontWeight="Bold" Margin="3,0,12,0" VerticalAlignment="Center"/>
<toolkit2:DatePicker x:Name="DateTimePicker"/>
</StackPanel>
<StackPanel x:Name="ButtonSP" Orientation="Horizontal"/>
</Grid>
</Grid>
</Grid>
TournamentsModifyControl.xaml
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Margin="0,4,0,4" Style="{StaticResource TaskGridMenuBarBorderStyle}" Grid.ColumnSpan="2" >
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition/>
</Grid.RowDefinitions>
<Border Style="{StaticResource TaskGridMenuBorderStyle}" Margin="0,0,25,0" Padding="10,0" Grid.ColumnSpan="1" HorizontalAlignment="Left">
<StackPanel x:Name="pnlTaskGridToolbar" Orientation="Horizontal">
<!-- save -->
<Button x:Name="SaveButton" Style="{StaticResource ImageButtonStyle}"
Click="SaveButton_Click" ToolTipService.ToolTip="Save Tournament Changes" Margin="0,0,5,0" >
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="../../Resources/Icons/Save.png" Margin="0,0,2,0" />
<TextBlock VerticalAlignment="Center">Save Tournament Changes</TextBlock>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
</Border>
</Grid>
</Border>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" x:Name="TournamentsSelectSP" Orientation="Horizontal" Margin="0,5,0,10">
<TextBlock x:Name="CurrentTournamentsLbl" Text="Current Tournaments:" FontWeight="Bold" VerticalAlignment="Center" Margin="0,0,10,0"/>
<ComboBox x:Name="CurrentTournamentsCbx"/>
</StackPanel>
<StackPanel Grid.Row="1" x:Name="LabelsSP" Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock x:Name="TournamentLbl" Text="Tournament Name:" FontWeight="Bold" Margin="0,0,10,0" VerticalAlignment="Center"/>
<TextBox x:Name="TournamentTbx" Width="100" MaxLength="255"/>
</StackPanel>
<StackPanel Grid.Row="2" x:Name="LocationSP" Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock x:Name="LocationLbl" Text="Location:" FontWeight="Bold" Margin="60,0,12,0" VerticalAlignment="Center"/>
<TextBox x:Name="LocationTbx" Width="100" MaxLength="255"/>
</StackPanel>
<StackPanel Grid.Row="3" x:Name="DateTimeSP" Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock x:Name="DateTimeLbl" Text="Tournament Time:" FontWeight="Bold" Margin="3,0,12,0" VerticalAlignment="Center"/>
<toolkit2:DatePicker x:Name="DateTimePicker"/>
</StackPanel>
</Grid>
</Grid>