Skip to content
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

Searching for a way to implement Multibinding with localized enum value #289

Open
JorisCleVR opened this issue Feb 5, 2021 · 1 comment

Comments

@JorisCleVR
Copy link

Because lex:LocProxy is deprecated I try to refactor my code.
I tried the following:
<TextBlock Style="{StaticResource DSTextBlock}" Grid.Row="3" Grid.Column="1"> <TextBlock.Text> <MultiBinding StringFormat="{lex:Loc LocalizationView_FormatText1}"> <Binding Path="Number1" /> <Binding Path="String1" /> <lex:BLoc Path="Enum1Value" Converter="{lex:PrependTypeConverter}" /> </MultiBinding> </TextBlock.Text> </TextBlock>

The value of LocalizationView_FormatText1 is: "This is a formated text with a number: {0}, a string: {1} and an enum: {2}."

Unfortunatly I get the following Exception: "Path not allowed for BLoc".

Am I missing something on how I could implement this?

@andrewalford1
Copy link

I've just came accross a very similar issue today. Checking out the source code it looks like setting the Path property just causes an exception to be thrown. I was able to get around this by using the Key property instead.

So my exmple looks like <lex:BLoc Key="Assembly:Resource:Key" />

/// <inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public new PropertyPath Path
{
get { return null; }
set
{
throw new Exception(nameof(Path) + " not allowed for BLoc");
}
}

Hope this helps,

Kind regards,

Andy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants