|
|
|
@ -15,6 +15,7 @@ namespace XamarinApp
|
|
|
|
|
public MainPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.option.Source = ImageSource.FromResource($"{this.GetType().Assembly.GetName().Name}.Images.options.png");
|
|
|
|
|
this._configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "config.txt");
|
|
|
|
|
if (!File.Exists(this._configFile))
|
|
|
|
|
{
|
|
|
|
@ -43,9 +44,13 @@ namespace XamarinApp
|
|
|
|
|
|
|
|
|
|
private async Task SetBaseUrl()
|
|
|
|
|
{
|
|
|
|
|
this._baseUrl = await DisplayPromptAsync("服务器", "配置服务器地址", "确定", "取消", this._baseUrl, keyboard: Keyboard.Url, initialValue: this._baseUrl);
|
|
|
|
|
var input = await DisplayPromptAsync("服务器", "配置服务器地址", "确定", "取消", this._baseUrl, keyboard: Keyboard.Url, initialValue: this._baseUrl);
|
|
|
|
|
if (!string.IsNullOrEmpty(input))
|
|
|
|
|
{
|
|
|
|
|
this._baseUrl = input;
|
|
|
|
|
File.WriteAllText(this._configFile, this._baseUrl);
|
|
|
|
|
this.webView.Source = this._baseUrl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|