Hello everybody,
I am new to WPF, I've been working on Infragistics products for Windows Forms and now I am trying to build from scratch a new app with WPF.
I am having troubles with localization for MessageBox. In WinForms, I used MessageBoxManager, using resCustomizer to customize (in my case, localize) messageBox buttons.
Is there a way to achieve the same goal with an Infragistics WPF control?
I took a look at this post: http://ko.infragistics.com/community/forums/p/91165/450498.aspx#450498
But I am not sure it fits my needs. I need a window with same functionality (and appeal) of a messagebox (icon, buttons, message, header, etc.)
Thanks in advance
Valentina
Hi Valentina,
You can try using our XamDialogWindow for that purpose and create own Message Box dialog which can be fully localized and retemplated as you wish. You can review our sample in the Samples Browser XamDialogDialog -> Display -> Showing the Dialog which demonstrates how to do that or review my sample application that I have attached as well.
If you have further questions do not hesitate to ask.
Sincerely,Teodor TenevSoftware Developer
Hi Teodor,
thanks for your feedback and please apologize me for the late reply
The example you provided is very good and can fit my goal. However, one tiny aspect is missing, that is the messageBoxIcon. In WinForms, this is a big image that we decide while initializing the message box (it's an enum).
is there something similar, or do I need to import the images as resources and add an Image control to the dialog Window (is it possible?) ?
Thanks again in advance
In order to do that you will need to retamplate the Header of the xamDialogWindow in order to set a custom icon. You can simply do it like this:In XAML:
<Grid.Resources> <DataTemplate x:Key="Error"> <StackPanel Orientation="Horizontal"> <Image Source="Images/error.png" Height="25" Width="25" Stretch="Fill"/> <TextBlock Text="Custom Header" Margin="5" FontWeight="Bold" FontSize="18.667" Foreground="#FF626262" VerticalAlignment="Center" /> </StackPanel> </DataTemplate></Grid.Resources>
winMB.HeaderTemplate = windowContainer.Resources["Error"] as DataTemplate;
I have attached an updated sample which demonstrates all that. If you need further assistance do not hesitate to ask.
GREAT!!!
Thank you!!!
Hi,
I am glad that I was able to help. And thanks for choosing Infragistics components.