Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.21 KB | None | 0 0
  1. <UserControl x:Class="ArbitrageClient.AddPurchaseUserControl"
  2.             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5.             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6.             xmlns:local="clr-namespace:ArbitrageClient"
  7.             mc:Ignorable="d"
  8.             d:DesignHeight="600" d:DesignWidth="800">
  9.     <Grid Margin="10">
  10.         <Grid.ColumnDefinitions>
  11.             <ColumnDefinition Width="Auto" />
  12.             <ColumnDefinition Width="Auto" />
  13.         </Grid.ColumnDefinitions>
  14.         <Grid.RowDefinitions>
  15.             <RowDefinition Height="Auto" />
  16.             <RowDefinition Height="Auto" />
  17.             <RowDefinition Height="Auto" />
  18.             <RowDefinition Height="Auto" />
  19.             <RowDefinition Height="Auto" />
  20.             <RowDefinition Height="Auto" />
  21.             <RowDefinition Height="Auto" />
  22.             <RowDefinition Height="Auto" />
  23.             <RowDefinition Height="Auto" />
  24.             <RowDefinition Height="Auto" />
  25.             <RowDefinition Height="Auto" />
  26.             <RowDefinition Height="Auto" />
  27.             <RowDefinition Height="Auto" />
  28.         </Grid.RowDefinitions>
  29.         <Grid.Resources>
  30.             <Style x:Key="TextBoxMarginStyle" TargetType="{x:Type TextBox}">
  31.                 <Setter Property="Margin" Value="0,2,0,2" />
  32.             </Style>
  33.             <Style TargetType="{x:Type ComboBox}">
  34.                 <Setter Property="Margin" Value="0,2,0,2" />
  35.             </Style>
  36.         </Grid.Resources>
  37.         <Label Grid.Row="0" Grid.ColumnSpan="2" FontWeight="Bold" HorizontalContentAlignment="Center">General</Label>
  38.         <Label Grid.Row="1" Grid.Column="0">Purchase date: </Label>
  39.         <DatePicker Grid.Row="1" Grid.Column="1" />
  40.         <Label Grid.Row="2" Grid.ColumnSpan="2" Visibility="Hidden">Placeholder</Label>
  41.         <Label Grid.Row="3" Grid.ColumnSpan="2" FontWeight="Bold" HorizontalContentAlignment="Center">Seller</Label>
  42.         <Label Grid.Row="4" Grid.Column="0">Name: </Label>
  43.         <TextBox Grid.Row="4" Grid.Column="1" />
  44.         <Label Grid.Row="5" Grid.Column="0">Street: </Label>
  45.         <TextBox Grid.Row="5" Grid.Column="1" />
  46.         <Label Grid.Row="6" Grid.Column="0">City: </Label>
  47.         <TextBox Grid.Row="6" Grid.Column="1" />
  48.         <Label Grid.Row="7" Grid.Column="0">Tel. number: </Label>
  49.         <TextBox Grid.Row="7" Grid.Column="1" />
  50.         <Label Grid.Row="8" Grid.Column="0">Comments: </Label>
  51.         <TextBox Grid.Row="8" Grid.Column="1" />
  52.         <Label Grid.Row="9" Grid.ColumnSpan="2" Visibility="Hidden">Placeholder</Label>
  53.         <Label Grid.Row="10" Grid.ColumnSpan="2" FontWeight="Bold" HorizontalContentAlignment="Center">Pricing</Label>
  54.         <Label Grid.Row="11" Grid.Column="0">Extra cost: </Label>
  55.         <ComboBox Grid.Row="11" Grid.Column="1" x:Name="extraCost">
  56.             <ComboBoxItem Tag="FuelCost">Fuel cost</ComboBoxItem>
  57.             <ComboBoxItem Tag="ShippingCost">Shipping cost</ComboBoxItem>
  58.             <ComboBoxItem Tag="ShippingIncluded">Shipping included</ComboBoxItem>
  59.         </ComboBox>
  60.         <Label Grid.Row="12" Grid.Column="0">Cost: </Label>
  61.         <TextBox Grid.Row="12" Grid.Column="1" Name="fuelCostTextBox">
  62.             <TextBox.Style>
  63.                 <Style BasedOn="{StaticResource {x:Type TextBox}}">
  64.                     <Setter Property="TextBlock.Visibility" Value="Collapsed"></Setter>
  65.                     <Style.Triggers>
  66.                         <DataTrigger Binding="{Binding ElementName=extraCost, Path=SelectedItem.Tag}" Value="FuelCost">
  67.                             <Setter Property="TextBlock.Visibility" Value="Visible" />
  68.                         </DataTrigger>
  69.                     </Style.Triggers>
  70.                 </Style>
  71.             </TextBox.Style>
  72.         </TextBox>
  73.         <TextBox Grid.Row="12" Grid.Column="1">
  74.             <TextBox.Style>
  75.                 <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBoxMarginStyle}">
  76.                     <Setter Property="TextBlock.Visibility" Value="Collapsed"></Setter>
  77.                     <Style.Triggers>
  78.                         <DataTrigger Binding="{Binding ElementName=extraCost, Path=SelectedItem.Tag}" Value="ShippingCost">
  79.                             <Setter Property="TextBlock.Visibility" Value="Visible" />
  80.                         </DataTrigger>
  81.                     </Style.Triggers>
  82.                 </Style>
  83.             </TextBox.Style>
  84.         </TextBox>
  85.         <Label Grid.Row="12" Grid.Column="1">
  86.             <Label.Style>
  87.                 <Style>
  88.                     <Setter Property="Label.Visibility" Value="Collapsed"></Setter>
  89.                     <Style.Triggers>
  90.                         <DataTrigger Binding="{Binding ElementName=extraCost, Path=SelectedItem.Tag}" Value="ShippingIncluded">
  91.                             <Setter Property="Label.Visibility" Value="Visible" />
  92.                         </DataTrigger>
  93.                     </Style.Triggers>
  94.                 </Style>
  95.             </Label.Style>
  96.             N/A
  97.         </Label>
  98.     </Grid>
  99. </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement