|
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.
|
|
|
|
|
Thank you for your answer. it solved my problem
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
|
|
|
|
|
Our WCF and database connections are designed to handle asynchronous calls without causing a race condition. I still use chained calls to the WCF, when loading the initial static data there can be 15-20 chained calls to load the static data.
While the static data may not be critical when opening a view the sequence and completeness of the data is critical. Therefore I use chained asynch call effectively turns it into a synch process. Only when the chain is complete the view is loaded.
My question is whether it would be better to send the calls asych and each callback set a flag and tries to load the view which then checks a bunch of flags to see if the data load is completed.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I can't help but think "you're doing it wrong" if you are calling into a WCF service 15 - 20 times at start up to "load static data". Can you wrap it all into a single call? If you are using SOAP, you are sending a lot of useless crap back and forth. If you need data from calls 1,2,6 and 8 to do calls 13 - 27, you should still probably try to encapsulate it all into a single call into the WCF service to cut down on the data (speed it up). If you only have .NET clients, you can optimize it further by switching to NetTCPBinding and get rid of SOAP. If you need to support non .NET clients as well, I'd suggest REST / Json.
How much data are we talking? How often does this "static" data change? If its a lot of data and it doesn't change too frequently, I'd recommend implementing a timestamp / version scheme. Instead of calling 15 - 20 times into the service, you'd do something like "I have version 1.04 of the data. Is there a newer version?" If so, then download it and cache it locally.
|
|
|
|
|
Static data is tiny, usually less than 100 rows per table/call. We are only .net, oh wait they are looking at mobile stuff as well and json is useful there.
I have not considered changing the binding, speed is not really an issue, I keep data small and we are all inside the firewall. I had not considered passing multiple collections or complex objects as it is not supported by basic binding (I think).
I certainly would not consider the versioning, just like I don't want to deal with caching as the size and speed is not really a problem.
I think I need to look into passing multiple tables and complex objects, one of the seniors devs is in my ear about doing that so I'll drop the problem on him
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Oh. I thought speed was your issue. I believe you can pass any serializable type. If you data is loaded by the time the view comes up, whats the issue? .
|
|
|
|