|
I am asking in wpf i.e., navigation between windows.
|
|
|
|
|
My bad - try this nifty focus change wpf navigation example[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
didnt find any solution..
|
|
|
|
|
I generally override the OnStartup method on my App class and then call my Login View modally, which returns a bool indicating whether login was successful. Something like this (very simplified):-
LoginView login = new LoginView();
login.ShowDialog();
if(login.LoginSuccess)
{
Mainwindow window = new Mainwindow();
}
else
{
}
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Found the solution
|
|
|
|
|
Excellent! It is a good idea to link to the articles/resources that you found useful as they will help the next person when they search this forum.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello.
I would like to present in a flat area a tree like view.
Each item would be a non-movable panel with its own controls. Each child will have connected with a line (Also selectable). On top of it, some childs are going to have multiple parrents. The closest that i have seen to compare is code map in VS2012 Update 2.
Example: Panel 1 and 2 are parents of panel 3
Panel1 Panel2
| |
---------
|
Panel3
I would like some pointers where to go, or if there is a custom control as long as it is free and can redistribute with or without source code. When i finish my personal project i will release source. As i am hobbiest programmer, my understanding on WPF is limited, so thank you for your time and patience.
|
|
|
|
|
|
Thanks for suggestion, but i didn't knew what to search. I am currently reading a WPF book and in a book i saw word diagram in it. At that moment i found WPF Diagram Designer article that is perfect. Since my native language is not english i could not remeber word, that would help me search on google
|
|
|
|
|
Maybe this is a simple question...
I created a search control in WPF. I then placed it on a view. Since the view doesn't know about the user control, how can it get data off of it, or make calls into it.
I tried using a messenger, but when there is more than one instance of the user control running, they al get the message.
What's the right way to do this?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Maxx wrote an article where his messages have a destination that consumes the message and it does not propagate further.
Just off the top of my head I would create a search interface on each VM that handles the interaction and pass the VM to the search VM onnavigateto of the view.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks
Can you point me to the article?
If it's not broken, fix it until it is
|
|
|
|
|
Bastards got 3 Xs[^] and underscores in his name, amazing what the mind thinks it sees
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
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..
|
|
|
|