-
Notifications
You must be signed in to change notification settings - Fork 4
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
Can preview lang in design time #2
Labels
Comments
I had a solution,
public class DesignViewModel: ViewModel
{
public DesignViewModel():base()
{
// load resource from file
//LanguageManager.Instance...
}
} modify Lang.cs from public class Lang : MarkupExtension
{
//...
public override object ProvideValue(IServiceProvider serviceProvider)
{
//...
}
} public class Lang : MarkupExtension
{
//...
public override Binding ProvideValue(IServiceProvider serviceProvider)
{
//...
}
} |
public class DesignViewModel
{
public DesignViewModel()
{
var ser = LanguageManager.Instance.LangService;
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Strings");
var zhNode = ser.EnsureGetLangNode("zh-cn");
zhNode.AddJsonFile(Path.Combine(path, "zh_cn", "hello.json"), false, true);
}
} Thanks @flier268 ! |
不客氣,順帶一提,Avalonia的正式版在axaml上不能用,preview可以有空的話請更新一下 |
Thanks a lot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: