Skip to content

Support dynamic language key#22

Open
Cricle wants to merge 1 commit into
mainfrom
support-dynamic-key
Open

Support dynamic language key#22
Cricle wants to merge 1 commit into
mainfrom
support-dynamic-key

Conversation

@Cricle

@Cricle Cricle commented Jul 15, 2024

Copy link
Copy Markdown
Owner

Import ILangKey interface and LangKey class for Ao.Lang, support dynamic language key.

Usage:

private ILangKey langKey = new LangKey();
Btn.BindLang(ContentProperty, langKey/*A interface impl*/,new object[] {"123"});

When changed LangKey.Key, the property will be raise update value.

Fixed #21

TODO:

  • Addin tests

@flier268

Copy link
Copy Markdown
Contributor

這樣的使用方式太繁瑣了,必需要給xaml上的元件一個name,然後在.cs裡面寫兩行,每一個綁定都要,如果我要做一個選單,選單內容來自資料庫,數量不特定,選單文字也要多國語言,這樣的寫法就很難達成,也無法MVVM

可以參考這個的做法

@Cricle

Cricle commented Jul 30, 2024

Copy link
Copy Markdown
Owner Author

這樣的使用方式太繁瑣了,必需要給xaml上的元件一個name,然後在.cs裡面寫兩行,每一個綁定都要,如果我要做一個選單,選單內容來自資料庫,數量不特定,選單文字也要多國語言,這樣的寫法就很難達成,也無法MVVM

可以參考這個的做法

麻烦是有点,但是我目标还是适用于任意UI框架的,所以我有空看看有没有类似你的但是更简单的方式去实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to achieve it if Key also needs to be dynamic? Key如果也要動態該如何達成

2 participants