|
Thanks for that Article link, i missed that one.
It's real cool and will be helpful later.
I think I haven't stated out what I really want to achieve.
For now, the purpose of my app is to create something like an style designer.
For that, I need to change the style it self on runtime.
The article assumes you have a number of ready styles you want to change, load and and unload in your skinnable application. That is not what I want to do. I want to change a given simple style to create a new one. When the user is ready with it, it should be saved as an dictionary.xaml file.
What happens then, load into an skinnable app as loose or compiled version doesn't matther at this point.
Thanks again.
|
|
|
|
|
hi i want to show notifications to user when it is uploading.like i want to show the current status while uploading in the label.so can anyone help how to do this in wpf?
|
|
|
|
|
Which part are you having trouble with?
You can set a label's content any time from code as long as you do it on the UI thread.
Have you tried something that isn't working? If so, can you show an example?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Huh?
Show some code! What have you tried? What's not working?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi guys
I use the following line of code to load .chm files whenever the user presses F1 on a textbox:
TextBox h:HelpProvider.HelpString="filename.chm"
But this only works when the .chm file is in the "bin" folder, how can I specify a different path to my help files?
I want to have a seperate folder called "help"
|
|
|
|
|
Etienne_123 wrote: how can I specify a different path to my help files?
By changing the value. If the help folder is to be deployed in a subfolder of the executable, you'd use @"Help\filename.chm"
"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
|
|
|
|
|
Thanks for the speedy reply, but that doesn't when I use work though, I get the following error message "Character sequence '@' was not expected at this location."
I'm guessing your code will work in the code behind file?! But it does not work when I use it in the XAML part.
PLEASE NOTE: I'm trying to integrate context sensitive help into my application, it has to load different help files depending on what control the user pressed F1 on. I'm using this part of code in the code behind file to display the help files:
static private void Executed(object sender, ExecutedRoutedEventArgs e)
{
//MessageBox.Show("Help: " + HelpProvider.GetHelpString(sender as FrameworkElement));
System.Windows.Forms.Help.ShowHelp(null, HelpProvider.GetHelpString(sender as FrameworkElement));
}
The main thing I'm trying to do here is to NOT hard code the path to my help files.
|
|
|
|
|
Etienne_123 wrote: I get the following error message "Character sequence '@' was not expected at this location."
I'm guessing your code will work in the code behind file?!
Doh. I should really check which forum I'm replying in first.
Etienne_123 wrote: PLEASE NOTE: I'm trying to integrate context sensitive help into my application, it has to load different help files depending on what control the user pressed F1 on. I'm using this part of code in the code behind file to display the help files:
Sounds like you need to use the good old MVVM pattern here, where the viewmodel would have knowledge of the help files associated with it.
"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
|
|
|
|
|
This[^] blog might help you out some.
"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
|
|
|
|
|
Hi.
I'm gonna add some items to a ListView in WPF ? (like this : http://i42.tinypic.com/2gvk8kl.png[^] )
I've searched Google , but I couldn't find what I wanted so far !
this is my ListView's XAML code :
<ListView Margin=<span style="color:#A31515;">"158,106,156,128"</span>>
<ListView.View>
<GridView>
<GridViewColumn Header=<span style="color:#A31515;">"ID"</span>/>
<GridViewColumn Header=<span style="color:#A31515;">"Number"</span>/>
<GridViewColumn Header=<span style="color:#A31515;">"Name"</span>/>
<GridViewColumn Header=<span style="color:#A31515;">"LName"</span>/>
</GridView>
</ListView.View>
</ListView>
|
|
|
|
|
ListView has Items and ItemsSource properties for its content.
You can use either one of these, where Items is a built-in collection of Objects
and ItemsSource can be a reference to any collection of your own that
implements the IEnumerable interface.
See Controls Content Model Overview[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
As I understood , I have to use something like this ! yeah ?
listview.ItemsSource = new byte[] { 0, 1, 2, 3 };
But it doesn't work
|
|
|
|
|
You haven't bound any of your columns to a member of your collection, so nothing will show.
Typically you'd do something like this:
public class MyItem
{
public string ID { get; set; }
public string Number { get; set; }
public string Name { get; set; }
public string LName { get; set; }
}
public class MyItemCollection : ObservableCollection<MyItem>
{
}
...
listview.ItemsSource = new MyItemCollection();
<ListView Name="listview" Margin="158,106,156,128">
<ListView.View>
<GridView>
<GridViewColumn Header="ID" DisplayMemberBinding="{Binding Path=ID}"/>
<GridViewColumn Header="Number" DisplayMemberBinding="{Binding Path=Number}"/>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}"/>
<GridViewColumn Header="LName" DisplayMemberBinding="{Binding Path=LName}"/>
</GridView>
</ListView.View>
</ListView>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a style defined in a resource dictionary that I'm merging in the app.xaml file. How do I make usercontrols in a separate assembly see the styles in the merged dictionary?
"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
|
|
|
|
|
Just to make sure I am understanding correctly:
Assembly A has some UserControls
Program B has some Resources and references Assembly A
You want the UserControls from A to use styles defined in B.
If that is what you are trying for, I have been able to use {DynamicResource StyleInB} on the UserControls (instead of {StaticResource StyleInB}).
|
|
|
|
|
I have some styles in a resource dictionary. The dictionary is merged in app.xaml file. I have other user controls in a class library, but they can't see the styles defined in the merged dictionary. What do I have to do to make that happen?
"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
|
|
|
|
|
If I understand your question correctly, this[^] should solve your problem. Please inform me if it is what you're looking for.
Eslam Afifi
|
|
|
|
|
All of my applications are designed this way.
MainApp.exe - has merged resources
LibraryOne - no resources, uses resource in MainApp.exe. Does not reference MainApp.exe. Resources here all use the DynamicResource mark up extenstion when assigning them.
LibraryTwo - no resources, uses resource in MainApp.exe. Does not reference MainApp.exe. Resources here all use the DynamicResource mark up extenstion when assigning them.
LibraryThr - no resources, uses resource in MainApp.exe. Does not reference MainApp.exe. Resources here all use the DynamicResource mark up extenstion when assigning them.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I'm sorry I couldn't reply to your message earlier because I was having exams and projects. I couldn't understand your message back then so I decided to get back to it after exams with a clear mind. Finally I got the time to try to understand it again and I'm confused.
Karl Shifflett wrote: All of my applications are designed this way.
MainApp.exe - has merged resources
LibraryOne - no resources, uses resource in MainApp.exe. Does not reference MainApp.exe. Resources here all use the DynamicResource mark up extenstion when assigning them.
Why do all your applications has the resources in the exe and the dlls uses these resources?
Trying to understand, I wrote some code trying to apply what you described and I don't know If it's what you meant or not.
Class1 in a library that doesn't reference the exe.
public class Class1
{
public static void Foo()
{
var resourceDictionary = new ResourceDictionary()
{
Source = new Uri(@"WpfApplication4;component\Dictionary1.xaml", UriKind.Relative)
};
Debug.WriteLine(resourceDictionary["msg"]);
}
}
The exe (which references the library which reside in the same directory) has Dictionary1.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mscorlib="clr-namespace:System;assembly=mscorlib">
<mscorlib:String x:Key="msg">Hello, world!</mscorlib:String>
</ResourceDictionary>
Then the exe calls the Foo method in the library (in debug) somewhere.
I don't know if this is near what you described or not. Or is it that the exe doesn't reference the dlls and use resources defined in the dlls and load them from code? It'd be great if you clarify this. Thank you.
Eslam Afifi
|
|
|
|
|
|
Mr. Karl,
Thank you so much for clarifying and the link for the article. Now I see why and how it works. I like the article, very useful , planning to read the available parts and waiting for the upcoming parts.
Eslam Afifi
|
|
|
|
|
Eslam,
Glad to help out. Have a great day!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
|
I have a custom control which dynamically add texboxes...This control is inherited from StackPanel....
Now I have a collection of textboxes which will dynamically added to the StackPanel.
I want to add a message control below each text box and manually hide and show that...which will have hanging kind of look...
My question is that, how can I add the message control dynamically below each textbox control?
I think I am trying to get the X, Y coordinates of the textbox on mousemove event and trying to place the message control but not able to get any result...
Can anybody help me?
Thanks in advance,
|
|
|
|