|
On Tab selection change event, give the datacontext to the textboxes.
Say for example for first tab, you have 3 textboxes in a grid and you provide the class object to be bound as datacontext of the grid; when you select that tab, again give the same object as datacontext to the grid.
grid.Datacontext = myClassObject;
Please see if this works for you.
|
|
|
|
|
Hey,
No it doesn't work.
The problem is when i switch to another tab and the come back the red Ellipsis disappear.
Thanks.
|
|
|
|
|
Hi!
I have been looking for a way to extend the default printdialog in PresentationFramework. I need to filter the available printers some how. Does anyone know if it is possible either to filter the printer queue datasource or to extend the dialog to add such functionallity?
Andreas Johansson
Senior Software developer at Tieto Sweden
|
|
|
|
|
|
Thank you for your reply.
I have already found those articles and posts but they all work with the windows forms version of the printDialog. I cant figure out how to apply the technique to the presentationframework PrintDialog.
Andreas Johansson
Senior software developer at Tieto Sweden
|
|
|
|
|
Well, there is always the option of constructing a completely new PrintFile dialog in WPF from scratch, but that seems like a lot of work..
|
|
|
|
|
I know
Looks like thats my only way out.
Andreas Johansson
Senior software developer at Tieto Sweden
|
|
|
|
|
Hi i am writing an application that has WPF as its front end and a Windows service which is responsible for scheduling and executing the my operations.
At the moment i use WCF to send live progress messages to the client from the service and i add this message to a listbox on the WPF listbox using the items.add function from the code behind, But the performance is very poor. I need help or suggestions on the best way to display this messages efficiently.
|
|
|
|
|
What sort of volume and why do you consider performance poor. You have described the standard architecture for a monitoring app!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I would bind a property containing the messages, perhaps a subset of messages, to a multiline textbox.
Andreas Johansson
Senior software developer at Tieto Sweden
|
|
|
|
|
Good Day
i have buttons and i have defined them like this
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Horizontal" Height="400">
<k:KinectTileButton Background="{x:Null}" BorderBrush="{x:Null}" Style="{x:Null}" x:Name="btnA" Click="btnA_Click" MinHeight="400" MinWidth="350" Width="198" >
<Image Source="../Images/A.png" />
</k:KinectTileButton>
<k:KinectTileButton Background="{x:Null}" Style="{x:Null}" BorderBrush="{x:Null}" MinHeight="400" MinWidth="350" Width="198" x:Name="btnB" Click="btnB_Click" >
<Image Source="/SchoolPlay1;component/Alphabets101/Images/B.png" />
</k:KinectTileButton>
<k:KinectTileButton Background="{x:Null}" Style="{x:Null}" BorderBrush="{x:Null}" x:Name="btnc" Click="btnC_Click" MinHeight="400" MinWidth="350" Width="198" >
<Image Source="/SchoolPlay1;component/Alphabets101/Images/C.png" />
</k:KinectTileButton>
</StackPanel>
</Grid>
and m gridlayout has the following properties
<Grid x:Name="LayoutRoot" MinHeight="768" MinWidth="1024" >
and my Page does not have with and height set as i want to cater for different resolutions.
if i remove the stackPanel , my buttons bring big nicely , but i need then in a Stackpanel kind of control so that they will be aligned in order , but when i have the stack panel in the , the buttons become small, can anyone help regarding this, below is the example of the image
Image Example[^]
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Hi Viswa,
Why do you need to use a StackPanel? Generally if you have a fixed layout panel, go with Grid.
But anyways, I dont know exactly how KinectTileButton works, but if you specify same size for MaxWidth and MinWidth, or MaxHeight and MinHeight, everything will remain same irrespective of the container.
Do let me know if you are looking for something else.
|
|
|
|
|
hi Abhishek
i resolved the issue by using a Uniform.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
You mean UniformGrid right.
Anyways, good to hear that.
|
|
|
|
|
Correct Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
i need a listview with textboxes,& get the value written in eacgh textbox of each row in listview...
|
|
|
|
|
With a little templating, you can achieve this quite easily.
E.g.
<ListBox x:Name="List" >
<ListBox.ItemTemplate >
<DataTemplate>
<StackPanel Orientation="Vertical" >
<TextBox />
<TextBox />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
|
|
|
|
|
ok...thanx
I have done the same thing...
|
|
|
|
|
I have this enum bound to a combo:
public enum BOMStatuses
{
[Description("Cancel")]
Cancel,
[Description("Cancelled")]
Cancelled,
[Description("Hold")]
Hold,
[Description("Priced")]
Priced,
[Description("Rejected With Reason")]
RejectedWithReason,
[Description("To Be Delivered")]
ToBeDelivered,
[Description("To Be Priced")]
ToBePriced,
[Description("To Be Ordered")]
ToBeOrdered
}
It's bound in the view like this:
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="..\Resources.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="BOMStatusList"
MethodName="GetValues"
ObjectType="{x:Type entity_enums:MaterialType}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="entity_enums:BOMStatuses"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<converters:BOMStatusToDescriptionConverter x:Key="BOMStatusToDescConverter"/>
</ResourceDictionary>
</Window.Resources>
and
<ComboBox Grid.Row="2"
Grid.Column="1"
TabIndex="0"
ItemsSource="{Binding Source={StaticResource BOMStatusList}}"
SelectedValue="{Binding SelectedBOMStatus}"
SelectedIndex="{Binding StatusIndex}"
Style="{StaticResource ComboBoxStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="0,20,20,2"
Width="250">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource BOMStatusToDescConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
In certain cases I only want to show 2 of the enum values. How can I filter this list of enum values?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Damn I was hoping for enlightenment on this one. The obvious answer is to move your enum to a table, add a filter flag and then build your enum based on the tabe. PIEBaldConsult has an article on doing that I believe. Personally I just keep the enum aligned with the table manually.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thats not the obvious answer . In fact, it sounds super duper overly complicated. Just wrap your ItemsSource collection in a CollectionView or CollectionViewSource and use the Filter.
|
|
|
|
|
Ah enlightenment
I always think the filter needs maintaining by the user and therefore move to a table! And I use Silverlight where the collectionview is not a standard collection (I think).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
CollectionViewSource is available in SL for sure. Not sure about CollectionView. They both kinda do the same thing, just a different format for the predicate function. OP didn't specify in which cases he wanted to limit the items, so... .
|
|
|
|
|
Good Day
I am building a Kinect Applications. So i am using WPF on my laptop with the resolution of
1920 * 1080
so everything looks great and last night , i wanted to test it on my Samsung HD TV 42 inch Plasma and my Buttons went missing.
So my TV resolution is 1024 x 768(NATIVE)
so i reduced my resolution to 1024 x 768 on my laptop and i experienced the same thing my TV was experiencing.
I need an Advice to adjust my apps layout to accommodate all resolutions from
1024 x 768(NATIVE) and higher resolution.
Here is an example of a Page that i have , so basically i am using navigation service i have one window that hold the frame and i make it full-screen and others are just pages.
<Page x:Class="SchoolPlay1.MainMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:Microsoft.Samples.Kinect.ControlsBasics"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:k="http://schemas.microsoft.com/kinect/2013"
xmlns:tk="clr-namespace:Microsoft.Kinect.Toolkit;assembly=Microsoft.Kinect.Toolkit"
KeepAlive="false"
Height="1008.94" Width="2086.684"
Title="MainMenu">
<Page.Background>
<ImageBrush ImageSource="/SchoolPlay1;component/Background/Background_Math.png" />
</Page.Background>
<Grid Canvas.Top="-16" x:Name="LayoutRoot" Width="1636">
<Grid Grid.Row="0" Margin="10,0,0,19.6">
<k:KinectUserViewer k:KinectRegion.KinectRegion="{Binding ElementName=kinectRegion}" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top" />
</Grid>
<k:KinectRegion x:Name="kinectRegion" Margin="-226,10,-224,6.8" HorizontalAlignment="Right" Width="2086">
<Grid x:Name="kinectRegionGrid" Margin="10,20,160,19.8">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="170" />
</Grid.RowDefinitions>
<k:KinectTileButton x:Name="btnAlphabets" Canvas.Left="386" Width="Auto" Height="Auto" Canvas.Top="98" Click="btnAlphabets_Click" Background="{x:Null}" BorderBrush="{x:Null}" Margin="29,53,1521.4,153.4">
<Image Source="/SchoolPlay1;component/MainMenuImages/Final_Alphabet.png" Height="426" Width="342" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnMath" Width="Auto" Height="Auto" Canvas.Top="98" Click="btnMath_Click" Canvas.Left="10" Background="{x:Null}" BorderBrush="{x:Null}" Margin="400,53,1137.4,153.4">
<Image Source="MainMenuImages/MathMenu.png" Height="429" Width="352" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnFruitAndVeg" Canvas.Left="702" Canvas.Top="117" Width="Auto" Height="Auto" Click="btnFruitAndVeg_Click_1" Background="{x:Null}" BorderBrush="{x:Null}" Margin="810,109,783.4,153.4">
<Image Source="MainMenuImages/FruitAndVegMenu.png" Height="386" Width="302" />
</k:KinectTileButton>
<k:KinectTileButton x:Name="btnMiscellaneouss" Width="Auto" Height="Auto" Background="{x:Null}" BorderBrush="{x:Null}" Margin="1161,141,431.4,198.4" Click="btnMiscellaneouss_Click" IsEnabled="False" >
<Image Source="MainMenuImages/Miscellaneous_Menu.png" Height="526" Width="302" />
</k:KinectTileButton>
<k:KinectTileButton Background="{x:Null}" BorderBrush="{x:Null}" x:Name="btnBack" Click="btnBack_Click" Height="Auto" Width="Auto" Margin="-212,257,211.4,-88" Grid.RowSpan="2" >
<Image Source="NavigationButtons/Back.png" Height="200" Width="500" />
</k:KinectTileButton>
</Grid>
</k:KinectRegion>
<tk:KinectSensorChooserUI HorizontalAlignment="Center" VerticalAlignment="Top" x:Name="sensorChooserUi" Margin="461,10,538,0" />
</Grid>
</Page>
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Cheat and wrap your grid in a viewbox. It will scale everything automatically. Quick and convenient if you aren't hung up on the aspect ratio changing from system to system.
|
|
|
|