小编Bel*_*ght的帖子

Visual Studio 代码片段 - 如何将第一个字母转换为小写

在 Visual Studio 中,我想更新 fullprop 片段以根据属性名称自动转换字段名称:(因此只需输入“属性名称”和“类型”)

public string MyTest
{
    get => _myTest;
    set
    {
        if (_myTest == value) return;
        _myTest = value;
        RaisePropertyChanged();
    }
}
private string _myTest;
Run Code Online (Sandbox Code Playgroud)

我找不到转换的MyProperty方法myProperty。我发现这个主题似乎适用于 VSCode,但在 Visual Studio 中不起作用。VSCode 中的代码片段似乎与 Visual Studio 不同,因为它$1$可以在 Visual Studio 中工作,但${1}不起作用。那么 Visual Studio 中有等效的方法吗?

感谢您的帮助 !

visual-studio code-snippets vscode-snippets

5
推荐指数
0
解决办法
324
查看次数

Xamarin Shell 引发不明确的路由匹配异常

在 Xamari.Forms 中,我在AppShell.xaml中使用以下路由声明:

 <FlyoutItem Title = "Toolbox"
             FlyoutDisplayOptions="AsMultipleItems"
             Route="Main">

      <ShellContent Title = "Toolbox"
                    ContentTemplate="{DataTemplate Views:Toolbox}"
                    Route="Toolbox"/>

 </FlyoutItem>

 <ShellContent Title = "Parameters"
               ContentTemplate="{DataTemplate Views:Parameters}"
               Route="Parameters"/>
Run Code Online (Sandbox Code Playgroud)

AppShell.xaml.cs中,我以编程方式为“工具箱”页面添加上下文页面导航:

public AppShell ()
{
    InitializeComponent ();

    Routing.RegisterRoute("Toolbox/TBOuvriers", typeof(TBOuvriers));

    BindingContext = this;
}
Run Code Online (Sandbox Code Playgroud)

当我尝试从工具箱页面显示上下文页面导航时:
await Shell.Current.GoToAsync("//Main/Toolbox/TBOuvriers");

我得到这个异常:

System.ArgumentException:匹配的模糊路由://Main/Toolbox/TBOuvriers 找到匹配项:
//Main/Toolbox/TBOuvriers/TBOuvriers,
//Main/IMPL_Toolbox/Toolbox/TBOuvriers
参数名称:uri

就在调用之前,我可以看到 Shell 变量的这些值:
Shell.Current.CurrentItem : "Title = Toolbox, Route = Main"
Shell.Current.CurrentState.Location : "{//Main/Toolbox}"

这似乎是预期的。

如果我尝试使用此调用显示页面:
await Shell.Current.GoToAsync("TBOuvriers");
我还得到一个异常:System.Exception:超时超出获取异常详细信息

所以有什么问题 ?
这些路线从哪里来?!?
为什么工具箱页面被注册两次?

欢迎所有想法!

此致

forms shell routes xamarin

3
推荐指数
1
解决办法
6015
查看次数