|
I Had the same problem and this was unfortunately the only solution I could think of.
private void TendererTabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
if (e.AddedItems[0].GetType().Name == "TabItem")
{
TabItem SelectedTab = (TabItem)e.AddedItems[0];
if (SelectedTab.Header.ToString() == "Tenderers")
{
.....
}
if (SelectedTab.Header.ToString() == "Contenders")
{
....
}
}
}
catch (IndexOutOfRangeException)
{
}
|
|
|
|
|
I have a bunch of .chm files which I added as resource files to my project, they're stored in a folder called Help.
I'm using the HelpProvider class as stated [here^] to load the appropriate help files when F1 is pressed.
Im my XAML I use the folling to specify the path to the help file:
h:HelpProvider.HelpString="mainscreen_help.chm"
But this only works when the help files are stored in the "bin" folder. How do I specify a path to the chm files stored in the Help subfolder?
Help/mainscreen_help.chm doesn't see, to work
|
|
|
|
|
First of all, you have copied the Help folder into the bin directory haven't you? You're using an app-relative path there, so the whole relationship has to be relative in the bin directory as well.
Secondly, and blowing my own trumpet a bit, there's a WPF based way to add help to your application descibed here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
No I haven't copied the Help folder to the bin folder, it's in the folder 2 folders back from the bin folder.
Shouldn't there just be a way to specify the path easily.
|
|
|
|
|
And the link you gave me still doesn't explain how to specify the path to a help file when it's located in a sub folder, it does exactly the same as the current class I'm using.
|
|
|
|
|
It would. Think about it for a second - when you deploy your application, the help folders are presumably going to exist somewhere under the directory where your executable resides. Hence, you have to replicate this in your application structure. WPF isn't magic, it can't know that you intend to deploy it differently; so copy your subfolder below the bin directory and mimic the live environment.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
How can i drag an item (list item) from its list and drop it outside the window and still handle the event?
Example: If i have a list controls which contains a list of filenames, then i drag 1 list item outside the main window and drop it, a message box is displayed which displays the filename.
I am planning to develop similar application which performs additional processes when an item is draged(and droped) outside the main window.
Please help.
|
|
|
|
|
yeah, I'm wondering that myself....I'm using an Adorner while DD-ing a listviewitem. Works great inside the app window....but I want to drop it on the desktop and perform some custom tasks there. No luck for now.
|
|
|
|
|
Hi,
I am working on WPF stack panel. In this I used to add items dynamically to the stack panel. Now If I click on the stackpanel item some message like the number of the child clicked should be displayed. Will there be any events for thi to checking the selected item of the stack panel.
If any one have any idea how to do this please reply me.
Thanks in advance
|
|
|
|
|
This might be somewhat complex.
Have a custom Routed event for the Canvas items.
Let the Canvas subscribe to this event.
The Canvas item fire's the routed event whenever it is selected.
When fired, the Canvas event handler gets invoked
In the handler, RoutedEventArgs parameter's OrignalSource property should give you the actual Canvas item that invoked the event.
|
|
|
|
|
Hi All,
I'm having a nightmare getting some XAML snippets adequately formatted for a new CP article. Anyone got any tips / working methods / tools that make this process easier?
Cheers,
|
|
|
|
|
I use Scrubber in MoXAML PowerToys[^] and the appropriate source language in the article template to accomplish this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Nice ...
|
|
|
|
|
I like it. The next version of MoXAML has something called Babelcode - it converts from VB.NET to C#, and vice versa.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Now that will be a wicked addition to the tool set. I really must get VS Standard or Pro for me at home. I so miss MoXAML at home with C# Express.
|
|
|
|
|
Hi,
i have a UserControl (CustomToolbar) with buttons like new, delete, ...
Also i have a UserControl (Customer) with Textboxes, Labels, ...
My UserControl (Customer) looks like this:
<UserControl x:Class="test.ucCustomer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:mekoOffice">
<local:bDockPanel>
<local:ucCustomToolbar x:Name="tbCustomer" DockPanel.Dock="Top" />
<local:ucStatusbar x:Name="stMain" DockPanel.Dock="Bottom" />
<Grid x:Name="grdMain">
If i click on the button new in my toolbar the new-method in UserControl (Customer) should be fired. In another scenario if i click on the button new in my toolbar the new-method in UserControl (Article) should be fired. How can i accomplish that.
thx,
zauberfisch
|
|
|
|
|
You need to have the button call a method which works out which of your two methods to call, and branches from there. OR you can reset the event handler every time, but the first way makes more sense
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
That Toolbar should be kind of generic. It should be used in all kind of different UserControls. Do you have an example?
thx,
zauberfisch
|
|
|
|
|
You could do this quite easily with a RoutedEvent. Alternatively, you could look into MVVM, and take a look at integrating the Mediator pattern with this here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Can you give me an example with a RoutedEvent, i get crazy because i don't understand how it works.
|
|
|
|
|
Pass the control with the buttons in it into the other controls, and subscribe to its button click events. This violates basic OOP principles, but if that's what needs to be done to process events, then so be it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
This sounds like a good scenario for Commands. You can make your button trigger the pre-defined New command like so:
<pre><Button Command="New">Click Me</Button></pre>
Then you can wire up a command binding anywhere up the visual chain from the toolbar to handle the New command. That handler will need to be able to determine which control method to call (which is basically CG's first suggestion).
|
|
|
|
|
Hi, I need make any animation of sound for my WPF aplication. I don't know how to get any data for my animation. Maybe intensity from left and right canal? I don't know how to get this data. Can anybody help me? Thanks
|
|
|
|
|
Yes, balance and volume are about the only things you could animate.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I searched articles on this site, this forum, and MSDN and could not find an answer, even though the actual code is probably very simple. How do I perform a lossless 90 degree rotation to a JPEG file using strictly WPF API's? I've seen code for using GDI+ only. I can't believe I have to step out of WPF to do this. I also need to preserve metadata.
I'm already accomplishing this with lossy compression but to minimize artifacts I have to set quality at maximum and this is doubling the size of my images.
|
|
|
|