|
Sorry about the XXX and _
It was originally underscore free but I had some hassle with the account and creatged a new one - and it wouldn't let me use Maxxx.
I actually wanted to use .\\axxx but it wouldn't let me do that either
Thanks for referring to my article, BTW
|
|
|
|
|
Not quite sure an "e.Handled = true" concept in messenger makes sense since the messages are going to be propogated in a random/arbitrary/indeterminate order. Its really up to the subscriber to determine if the message should be handled. Your "e.Handled = true" concept might just mean that somebody handled it and its up to the subcriber to play nice and check the flag. A lot of messenger implementations fire & forget the notifications in async mode too. Then it makes even less sense.
|
|
|
|
|
I'm afraid I subscribe to fire and forget school and have not implemented the Handled concept. I do have trouble defining the boundaries of where a message should be used!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Now that I'v had a few days to thin about it, the subscriber should pass in it's id to the control Init. Could be a PK or a guid. If there are 3 tabs open, each instance of control would be intiailized with a different id.
Then, each subsequent call would have that Id passed with it. Then control's methods would only act if the Id passed in the message matches that sent in the 'init' method.
If it's not broken, fix it until it is
|
|
|
|
|
That's about how I would do it - although pass a reference to the object rather than just an Id - you then have the advantage of being able to access the object in question from your consumer.
Send Message - "I've just updated this Customer"
Receive Message - do nothing - not interested in this customer
Receive Message - update my list of customers as the value in the CustomerType property matches my filtering criteria.
Receive Message - I'm displaying this actual customer - so I'll refresh myself
the 'handled' approach can be useful; my example is selecting a customer to edit from a list.
If an existing customer edit view is out there, in a 'clean' state, it can take over the job of editing the selected customer - but you don't want another view to do the same thing too!
|
|
|
|
|
Hello,
I have a tab control with two tabs in it,in each tab i have text boxes, the data of the text boxes is being validated using the IDataErrorInfo interface.
If there is an invalid data i am rendering a red ellipsis and a tool tip box using this XAML code:
<ControlTemplate x:Key="TextBoxErrorTemplate">
<DockPanel>
<Ellipse DockPanel.Dock="Right" Margin="2,0" ToolTip="Contains invalid data" Width="10" Height="10" >
<Ellipse.Fill>
<LinearGradientBrush>
<GradientStop Color="#11FF1111" Offset="0" />
<GradientStop Color="#FFFF0000" Offset="1" />
</LinearGradientBrush>
</Ellipse.Fill>
</Ellipse>
<AdornedElementPlaceholder />
</DockPanel>
</ControlTemplate>
Text box XAML:
<TextBox.Text>
<Binding Path="ID" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <DataErrorValidationRule/> </Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
The problem is when i go to another tab and then come back again the red Ellipses are disappear.
Help any one?
Thanks
|
|
|
|
|
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
|
|
|
|