Xaml designer behaves differently in VS 2012 and VS 2010 - visual-studio-2010

I recently switched to Visual Studio 2012 from VS2010.
I have some user controls which are templates for other user controls.
The first ones have some ContentControl whose content is defined in the second ones.
Follows the definition of a user control based on a template control (ImpegniBaseView)
<localView:ImpegniBaseView>
<localView:ImpegniBaseView.ActionButtons>
<StackPanel Height="54" HorizontalAlignment="Left" VerticalAlignment="Top" Width="668" Orientation="Horizontal">
<Button Content="Salva" Height="31" Width="88" Command="{Binding Path=SaveCommand}" IsEnabled="{Binding Editable}" Margin="5,0" />
<Button Command="{Binding Path=CreateCommand}" Content="Nuovo impegno master" Height="31" Width="Auto"
Visibility="{Binding IsFirstLevelView, Converter={StaticResource BoolToVisibility}}"
IsEnabled="{Binding Path=Editable, Converter={StaticResource InverseBooleanConverter}}" Margin="5,0" />
</StackPanel>
</localView:ImpegniBaseView.ActionButtons>
</localView:ImpegniBaseView>
In Vs 2010 I could easily select, for example, the button 'Salva' in the designer. Now I cannot. I suppose I have to change an option in the designer, but I don't know which one...
Update
Follows the relevant part of the user control used as template
<UserControl x:Class="Ragioneria.View.ImpegniBaseView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ragioneria"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="700">
<DockPanel DataContext="{Binding ImpegnoSelezionato}">
<DockPanel DockPanel.Dock="Top">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
<Label Content="Anno/Num-Sub" Height="28" HorizontalAlignment="Left" Margin="5" Name="label1" VerticalAlignment="Top" Width="Auto" />
<ContentControl Content="{Binding Path=IdentificazioneImpegnoSection, RelativeSource={RelativeSource AncestorType=UserControl}}" Width="400" Height="28" Margin="5" />
</StackPanel>
<TextBox Height="28" Width="100" Name="textBox9" Text="{Binding Path=DataRegistrazione, StringFormat=d}" DockPanel.Dock="Right" Style="{DynamicResource tb_readonly}" TextAlignment="Right" Margin="5" />
<Label Content="Data" Height="28" Margin="5" Name="label7" Width="50" DockPanel.Dock="Right"/>
</DockPanel>
<ContentControl DockPanel.Dock="Bottom"
DataContext="{Binding DataContext.ActiveWorkspace, RelativeSource={RelativeSource AncestorType=Window}}"
Content="{Binding Path=ActionButtons, RelativeSource={RelativeSource AncestorType=UserControl}}" />
</DockPanel>
Thanks
Filippo

You must add [AlternateContentProperty] to ActionButtons.
Unfortunately, unlike in Silverlight, you won't find this attribute in standard library.
Instead, you will need to use Microsoft.Windows.Design.PropertyEditing.AlternateContentProperty from Microsoft.Windows.Design.Interaction.dll.
Since this is a non-redistributable dll from Visual Studio, you can't reference it directly and have to create designer metadata assembly.
See this bug
and vote here.

Related

How do I change the Button background using Behaviors?

<Button Height="50" BorderBrush="IndianRed" Margin="5,0,0,0"
x:Name="aBtn">
<Button.Resources>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="IndianRed"/>
</Button.Resources>
<StackPanel Orientation="Vertical">
<TextBlock Text="Heating" />
</StackPanel>
<iActivity:Interaction.Behaviors>
<iAction:ChangePropertyAction PropertyName="Background" Value="IndianRed" TargetObject="aBtn" />
</iActivity:Interaction.Behaviors>
This doesn't work. (I'm using WinUI3 Preview 4)
TargetObject="{Binding ElementName=aBtn}" is needed.

How can I use the Design Tab in Visual Studio when designing XAML UI for a UWP App that uses Data Template in List View?

This is a bit of a tricky question to put succinctly but here goes. Snippets have been included to get the point across.
This problem came about whilst trying to solve another problem, to which a solution was found on SO, but which required to right-click and edit the default style of a TextBox, which I can't do because the TextBox in question is part of a DataTemplate on a databound ListView which of course has no content at design time.
Here are some snippets: I use a data template to control the content/layout of my listview like so:
<ListView x:Name="DataItemList"
ItemsSource="{x:Bind MasterMenuItem.DataObjects, Mode=OneWay}"
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
SelectionMode="Single"
ItemTemplate="{StaticResource DataListItemTemplate}">
</ListView>
and a data template as a page/control resource
<DataTemplate x:Key="DataListItemTemplate" x:DataType="vm:DataObjectListItem">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<Grid Height="40" Margin="10 0 0 0">
<Grid.Resources>
<SolidColorBrush x:Key="brush" Color="Silver"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" />
<ColumnDefinition Width="*" MinWidth="240" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="{StaticResource brush}" BorderThickness="1 1 1 1">
<FontIcon Name="Icon"
Grid.Column="0"
VerticalAlignment="Center"
FontSize="32"
Glyph="{x:Bind ListItemIcon}" />
</Border>
<Border Grid.Column="1" BorderBrush="{StaticResource brush}" BorderThickness="1 1 1 1">
<TextBlock Name="Data Object Name"
Padding="6 4 6 4"
Text="{x:Bind Name, Mode=OneWay}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="Bold"
TextWrapping="WrapWholeWords"/>
</Border>
</StackPanel>
</DataTemplate>
When I view my page in the Design tab of visual studio (instead of the XAML tab) I see nothing useful, unlike if, for example, I put a TextBlock in my XAML with Text="Hello" I would be able to see 'Hello' in the Design tab and crucially Right-Click on it to do certain things...
Is there a way to 'populate' the list with some dummy data, or the text box with some dummy text in order to visualize the runtime layout in the Design tab?

Silverlight Value does not fall within expected range when trying to open a xaml

I receive the following message in a simple message pop up, when trying to open the designer of some of my xaml files:
"Value does not fall within expected range"
I've tried to create a new windows and open the xaml files in notepad and copy them in the new one, but even with a new control it gives me this error without even having modifying it.
Here's one of the xamls that gives me an error:
<controls:ChildWindow x:Class="Playground.Views.MessageWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Width="343" Height="159"
Title="MessageWindow" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<Grid x:Name="LayoutRoot" Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="316*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="216*" />
<RowDefinition Height="32" />
</Grid.RowDefinitions>
<Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,9,0,0" Grid.Row="1" Grid.ColumnSpan="2" />
<dxe:TextEdit HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" Name="txtMessage" IsReadOnly="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Background="#FFE7E9EC" />
</Grid>
And here's one that doesn't have this problem:
<controls:ChildWindow x:Class="Playground.Views.LogIn"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Width="270" Height="200"
Title="Log In" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<Grid x:Name="LayoutRoot" Margin="2">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
<Button x:Name="OKButton" Content="Log In" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
<sdk:Label Height="23" HorizontalAlignment="Left" Margin="18,23,0,0" Name="label1" VerticalAlignment="Top" Width="60" Content="Username" />
<sdk:Label Height="23" HorizontalAlignment="Left" Margin="18,56,0,0" Name="label2" VerticalAlignment="Top" Width="60" Content="Password" />
<dxe:CheckEdit HorizontalAlignment="Left" Margin="18,85,0,0" Name="checkEdit1" VerticalAlignment="Top" Width="92" Content="Use CIL/CIP" IsThreeState="False" Checked="checkEdit1_Checked" Unchecked="checkEdit1_Unchecked"/>
<dxe:CheckEdit Margin="116,85,0,0" Name="remUNCE" VerticalAlignment="Top" Content="Save Username" IsThreeState="False" HorizontalAlignment="Left" Width="120" Checked="remUNCE_Checked" Unchecked="remUNCE_Unchecked"/>
<dxe:TextEdit HorizontalAlignment="Left" Margin="86,23,0,0" Name="textEdit1" VerticalAlignment="Top" Width="136" Text="administrator" />
<dxe:PasswordBoxEdit HorizontalAlignment="Left" Margin="86,56,0,0" Name="passwordBoxEdit1" VerticalAlignment="Top" Width="136" />
</Grid>
I tried searching for this problem on the internet but all i got were results for duplicate names in the same xaml, which is not the case here, also i'm not injecting any controls in codebehind so there shouldn't be any problem regarding duplicate names.
i use visual studio 2010 and also in case it has any relevance i have devexpress installed, but when i started getting this error i had an earlier version so i upgraded it to the latest in hopes of fixing it, but no luck.

Using Expensify Windows Phone Test Framework to trigger an ApplicationBar button

I've just started using the Expensify Windows Phone Test Framework and it seems to fit my requirements for automated testing of Windows Phone 7.1 quite well. I can get it to trigger a normal button on the screen but cannot get it to trigger either of my ApplicationBar buttons.
The XAML for this test page is ...
<phone:PhoneApplicationPage x:Class="SampleApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:AppBarUtils="clr-namespace:AppBarUtils;assembly=AppBarUtils"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait"
Orientation="Portrait"
mc:Ignorable="d"
d:DesignWidth="480"
d:DesignHeight="768"
shell:SystemTray.IsVisible="True"
DataContext="{Binding Main, Source={StaticResource Locator}}">
<!--LayoutRoot contains the root grid where all other page content is placed-->
<Grid x:Name="LayoutRoot"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel"
Grid.Row="0"
Margin="24,24,0,12">
<TextBlock x:Name="ApplicationTitle"
Text="{Binding ApplicationTitle}"
Style="{StaticResource PhoneTextNormalStyle}" />
<TextBlock x:Name="PageTitle"
Text="{Binding PageName}"
Margin="-3,-8,0,0"
Style="{StaticResource PhoneTextTitle2Style}" />
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentGrid"
Grid.Row="1">
<StackPanel Margin="24,20,0,123" Orientation="Vertical">
<TextBlock Text="{Binding Welcome, Mode=OneWay}"
Style="{StaticResource PhoneTextNormalStyle}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="6,0,19,0" TextWrapping="Wrap" Width="431" />
<TextBlock Text="Enter first number"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="6,20,0,0" TextWrapping="Wrap" />
<TextBox TextChanged="OnTextBoxTextChanged"
Text="{Binding EnteredAmount1, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
x:Name="txtValue1"
HorizontalAlignment="Left" Height="72" VerticalAlignment="Top" Width="456"
TextWrapping="Wrap" InputScope="Number"/>
<TextBlock Text="Enter second number"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="6,0,0,0" TextWrapping="Wrap" />
<TextBox TextChanged="OnTextBoxTextChanged"
Text="{Binding EnteredAmount2, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
x:Name="txtValue2"
HorizontalAlignment="Left" Height="72" VerticalAlignment="Top" Width="456"
TextWrapping="Wrap" InputScope="Number"/>
<TextBlock Text="Result"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="6,20,0,0" TextWrapping="Wrap"/>
<TextBlock Text="{Binding Total, Mode=OneWay}"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="15,0,0,0" TextWrapping="Wrap"
Width="422" Height="45"/>
<Button x:Name="btnAdd" Command="{Binding AddCommand}" Content="Add" Margin="240,0,0,0" />
</StackPanel>
</Grid>
</Grid>
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
<shell:ApplicationBarIconButton x:Name="AddAppBarBtn" IconUri="/Images/ApplicationBar.Check.png" Text="add"></shell:ApplicationBarIconButton>
<shell:ApplicationBarIconButton x:Name="SubtractAppBarBtn" IconUri="/Images/ApplicationBar.Cancel.png" Text="subtract"></shell:ApplicationBarIconButton>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
<i:Interaction.Behaviors>
<AppBarUtils:AppBarItemCommand Id="add" Command="{Binding AddCommand}"/>
<AppBarUtils:AppBarItemCommand Id="subtract" Command="{Binding SubtractCommand}"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<AppBarUtils:AppBarItemTrigger Type="Button" Id="add" Text="add" />
<AppBarUtils:AppBarItemTrigger Type="Button" Id="subtract" Text="subtract" />
</i:Interaction.Triggers>
</phone:PhoneApplicationPage>
The SpecFlow features are defined as follows ...
Scenario: AppBar Add Two Numbers
Given my app is uninstalled
And my app is installed
And my app is running within 20 seconds
Then I enter "34" into the control "txtValue1"
Then I enter "23" into the control "txtValue2"
Then I press the control "AddAppBarBtn"
Scenario: Button Add Two Numbers
Given my app is uninstalled
And my app is installed
And my app is running within 20 seconds
Then I enter "34" into the control "txtValue1"
Then I enter "23" into the control "txtValue2"
Then I press the control "btnAdd"
The ButtonAddTwoNumbers scenario fully works. The AppBarAddTwoNumbers fills in the text box values but refuses to press the button, The error I get is "Failed to set focus to control 'AddAppBarBtn'".
Any help on this would be appreciated.
I think you are working one level too high. Personally I wouldn't normally test the UI itself as in the long term it just leads to brittle tests that constantly need changing. Instead I would normally come down to the ViewModels.
So given that your txtValue1 is bound to EnteredAmount1, txtValue2 is EnteredAmount2 and AddAppBarBtn is AddCommand, you can test your business logic as
Scenario: AppBar Add Two Numbers
Given I enter 34 into Amount1
And I enter 23 into Amount2
When I add them #Calls AddCommand
Then Total should be 57
This means that you can redesign your UI very easily, so say for example if we wanted to use sliders instead of textboxes, there would be NO changes to the above logic tests.
In addition you can still test your UI features as seperate features
Scenario: Check startup
Given my app is uninstalled
When my app is installed
Then my app should be running within 20 seconds
And if you really want you can still check your bindings too
Scenario: Check bindings
Given I enter 34 into Amount1
Then control txtValue1 should be 34
In this way you'll break your tests into smaller chunks of the application and give yourself more targetted failures, which is really useful when tracking down any problems.

WPF 4.0 AutoCompleteBox TwoWay Binding

I have a WPF window that has several Listbox and DataGrid controls. The main Listbox displays a list of Contractors. An Address(s) datagrid is bound to the Contractor ListBox and displays address(s) for the current selected Contractor.
I want users of this Window(WPF) to be able to add Addresses to the selected Contractor using the native Datagrid Add functionality. I also want the users to be able to edit associated Address records by clicking in the datagrid cell and having the cell function as an AutoCompleteBox.
I have partially successfully implemented the AutoCompleteBox in the State column of the datagrid control. Currently, the correct Text value for the current Contractor is displayed in the State column of the Address datagrid. If i edit the State cell I get expected autocomplete functionality and I can select a new State.
What is not working is the TwoWay binding. Currently, if I change the current Address state it does not save back to the entity model or the db. Its not surprising since I know I dont have Twoway binding implemented correctly on this control.
I have successfully implemented the Twoway binding with a combobox but the combobox obviously does not provide the autocomplete functionality I need.
Update
We worked on this late yesterday and arrive at a partial solution. Now we have a new issue.
With a ComboBox you can have:
DisplayMemberPath ="StateAbbrv"
SelectedValue="{Binding Path=tbl_Address.StateID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" and
SelectedValuePath="StateID".
With the AutoCompleteBox it seems you really only have:
ValueMemberPath="StateID" and
Text="{Binding Path=tbl_Address.StateID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource StateConverter}}" Grid.Column="1" Grid.Row="1" Margin="0,0,0,0" >
With the AutoCompleteBox you can’t have separate display and selected values. Because of my Window control binding and database structure I need to display a string value such as “CA California” while actually having a selected table key integer value in the background.
To be clear, we need to have separate Display and Selected values in the Text part of the AutoCompleteBox control.
Here is the Master ListBox displaying Contractors:
<Grid DataContext="{StaticResource tbl_PartnerViewSource}" HorizontalAlignment="Left" Name="grid3" VerticalAlignment="Top" Height="242" Width="295" Grid.Column="1" Margin="0,1,0,0" Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition Height="31*" />
<RowDefinition Height="211*" />
</Grid.RowDefinitions>
<Label Content="Contractor List" FontWeight="Bold" Height="25" Margin="0,0,169,0" Name="label10" Padding="3" VerticalAlignment="Top" />
<ListBox DisplayMemberPath="tbl_Organization.OrgName" Height="212" HorizontalAlignment="Right" ItemsSource="{Binding}" Margin="0,30,0,0" Name="orgNameListBox" SelectedValuePath="PtnrID" VerticalAlignment="Center" Width="294" IsSynchronizedWithCurrentItem="True" Grid.RowSpan="2" SelectionChanged="orgNameListBox_SelectionChanged" TabIndex="11" MouseDoubleClick="orgNameListBox_MouseDoubleClick" DataContextChanged="orgNameListBox_DataContextChanged" SourceUpdated="orgNameListBox_SourceUpdated" IsManipulationEnabled="True" />
</Grid>
Here is the Stack Panel containing the Datacontext supporting the controls in discussion:
<StackPanel Grid.Row="3" Height="243" HorizontalAlignment="Left" Name="stackPanel5" VerticalAlignment="Top" Width="295" Grid.Column="1"></StackPanel>
<Label Content="Address(s)" FontWeight="Bold" Height="25" HorizontalAlignment="Left" Margin="306,0,0,0" Name="label1" Padding="3" VerticalAlignment="Top" Width="648" Grid.Column="1" Grid.Row="1" />
<DataGrid Name="dataGridAddress" DataContext="{StaticResource tbl_Partnertbl_PartnerAddressViewSource}" ItemsSource="{Binding}" SelectionMode="Single" SelectionUnit="CellOrRowHeader" AutoGenerateColumns="False" AlternatingRowBackground="#FFFF003B" AlternationCount="2" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Margin="308,22,0,0" Width="649" Height="113" VerticalAlignment="Top" CanUserDeleteRows="True" CanUserAddRows="True">
<DataGrid.Columns>...
Here is the AutoCompleteBox that is partially working:
<DataGridTemplateColumn x:Name="addState" Header="State" Width="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<my1:AutoCompleteBox Name="autoCompleteBox1"
IsTextCompletionEnabled="True"
ItemsSource="{Binding Source={StaticResource tbl_StateViewSource}}"
ValueMemberPath="StateID"
Text="{Binding Path=tbl_Address.StateID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="1" Margin="0,0,0,0" >
<my1:AutoCompleteBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=StateAbbrv}" Width="30" FontWeight="Bold" Margin="0,0,0,0" />
<TextBlock Text="{Binding Path=StateName}" />
</StackPanel>
</DataTemplate>
</my1:AutoCompleteBox.ItemTemplate>
</my1:AutoCompleteBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Here is the Combobox with working TwoWay binding:
<GridViewColumn x:Name="addrState" Header="State" Width="75">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox Name="comboAddressState" SelectedValue="{Binding Path=tbl_Address.StateID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin2}" DisplayMemberPath="StateAbbrv" SelectedValuePath="StateID" ItemsSource="{Binding Source={StaticResource tbl_StateViewSource}}" IsSynchronizedWithCurrentItem="False" IsEnabled="True" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Here is the Windows.Resource Section:
<Window.Resources>
<CollectionViewSource x:Key="tbl_PartnerViewSource" d:DesignSource="{d:DesignInstance my:tbl_Partner, CreateList=True}"></CollectionViewSource>
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerAddressViewSource" Source="{Binding Path=tbl_PartnerAddress, Source={StaticResource tbl_PartnerViewSource}}" />
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerContactViewSource" Source="{Binding Path=tbl_PartnerContact, Source={StaticResource tbl_PartnerViewSource}}" />
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerContacttbl_PartnerContactCommChanAddrViewSource" Source="{Binding Path=tbl_PartnerContactCommChanAddr, Source={StaticResource tbl_Partnertbl_PartnerContactViewSource}}" />
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerSystemViewSource" Source="{Binding Path=tbl_PartnerSystem, Source={StaticResource tbl_PartnerViewSource}}" />
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerAliasViewSource" Source="{Binding Path=tbl_PartnerAlias, Source={StaticResource tbl_PartnerViewSource}}" />
<CollectionViewSource x:Key="tbl_Partnertbl_PartnerCommentViewSource" Source="{Binding Path=tbl_PartnerComment, Source={StaticResource tbl_PartnerViewSource}}" />
<CollectionViewSource x:Key="tbl_ServicedCustomerViewSource" d:DesignSource="{d:DesignInstance my:tbl_ServicedCustomer, CreateList=True}" />
<CollectionViewSource x:Key="tbl_SystemViewSource" d:DesignSource="{d:DesignInstance my:tbl_System, CreateList=True}" />
<CollectionViewSource x:Key="tbl_PlatformViewSource" d:DesignSource="{d:DesignInstance my:tbl_Platform, CreateList=True}" />
<CollectionViewSource x:Key="tbl_ManufacturerViewSource" d:DesignSource="{d:DesignInstance my:tbl_Manufacturer, CreateList=True}" />
<CollectionViewSource x:Key="tbl_StateViewSource" d:DesignSource="{d:DesignInstance my:tbl_State, CreateList=True}" />
<CollectionViewSource x:Key="tbl_ZIPViewSource" d:DesignSource="{d:DesignInstance my:tbl_ZIP, CreateList=True}" />
<CollectionViewSource x:Key="tbl_CityViewSource" d:DesignSource="{d:DesignInstance my:tbl_City, CreateList=True}" />
<Thickness x:Key="Margin1">8,-3,-7,-3</Thickness>
<Thickness x:Key="Margin2">-7,-3,-7,-3</Thickness>
</Window.Resources>
Here is a image of the Window(WPF):

Resources