-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set title and description for CustomDialogWith<T> #1491
Comments
Hallo, you have some options here. Short : if you use the Custom UI you have access to each Dialog and here you can just replace Placeholder to your string Title, thats it. Long Version : Each Dialog , if it WPF and C#, can be bound to Property of Title and UI / View map Title to Property and you can only change this Property and your Titlename will be change automatically. In Template of Wix# WPF C# Oleg use Caliburn.Micro Framework. Some Link for MVVM :
and for learn https://www.tutorialspoint.com/mvvm/index.htm, for understanding. Best regards, Torchok. |
Yes, this can be done when you inherit from WpfDialog. What I am curious is how this can be done when you don't use that, for example in sample CustomUIDialog.WPF with CustomDialogPanel : UserControl, IWpfDialogContent. |
just looked myself tosample CustomUIDialog.WPF. Example use already MVVM Framework. This is Caliburn.Micro. You can create string Property and bind Title to it. private stirng _title;
public string TitleText
{
get { return _title; }
set
{
_title = value;
}
} in C# code and add into UserControl TextBlock on top of him something like TextBlock Text = "{Binding TitleText }". Has to be something like this, because usercontrol doesnt has property Title like WPF Window. |
I can bind wpf elements, but the title and description comes from managed form host? |
and may i ask, why you want to use usercontrols for WPF UI and not standard WPF UI from Template of Wix# ? |
AFAIK oleq self suggest always to use Custom UI Template of v3 or V4 for WPF if you want to maximaze your flexibility for build UI and MSI, whatever you want Bootstrapper Application or MSI embeded in it. I had near ~90% installers with template and this works always. |
Yeah, seems so. However, if you are left with above default texts, the sample is not really usable in any scenario, might be an idea to just remove it. |
maybe. But for some unknown reason, @oleg-shilo created it and add it to samples. |
@anv1l, the code sample you are asking about specifically demonstrates how to provide minimalistic content of a custom dialog without changing any UI elements shared with other dialogs (e.g. dialog title or description label). And yet it is exactly what you are trying to do - customize that shared content. That's you are much better off by using the custom UI VS template where you have access to all UI elements including the ones that you specifically mentioned (title and description label). |
I am not sure if I could have been more clear; it's in the issue topic already. I was only asking if the title and description could be changed when using CustomDialogWith (as used in the samples). That's all. I did not think it would make sense to have that feature without being able to change those values and assumed you could change them somehow - and avoid modifying my installer solution to work with WpfDialog. |
Appologies, I indeed misunderstood what you are trying to do. And indeed the sample were discussing does not explain how to control the localization of the custom dialog content. What you need to do is to add the new content to the localization data. Either with the WXL file or dynamically at runtime. project.UIInitialized += e =>
{
// Since the default MSI localization data has no entry for 'CustomDlgTitle' (and other custom labels) we
// need to add this new content dynamically. Alternatively, you can use WiX localization files (wxl).
MsiRuntime runtime = e.ManagedUI.Shell.MsiRuntime();
runtime.UIText["CustomDlgTitle"] = "My Custom Dialog";
runtime.UIText["CustomDlgTitleDescription"] = "My Custom Dialog Description";
}; I have updated the sample to reflect on how to do that: |
- #1503: %AppData% folder no replace by path wix4 - #1493: Question : Make Wix# Wix Toolset v5 compatible - #1491: How to set title and description for CustomDialogWith<T> - #1310: Problem during dynamic localization - Enhancement #1497: MSI language - Improved algorithm for locating compatible version of installed WiX extension file. - Added extension method for reading localized strings from wxl files: `product.LocalizationFile.GetLocalizedString("ProductName")`</releaseNotes>
Most likely silly question but... well, the title says it all. Now I just get the default placesholder values.
The text was updated successfully, but these errors were encountered: