小编Sha*_*med的帖子

包含类型未实现接口“IComponentConnector”

IComponentConnector在生成的cs文件中实现

由于某种原因,Visual Studio不会编译以下代码。
我使用的是.NET 6 WPF。
是否有任何重大更改不允许我再扩展System.Windows.Window
我无话可说。该错误没有任何意义。
我将在窗口下面发布我的 xaml 和 cs:

<local:ExtendedWindow x:Class="Enciphered.Wpf.Window1"
                      x:TypeArguments="local:RoundedWindowViewModel"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      xmlns:local="clr-namespace:Enciphered.Wpf"
                      mc:Ignorable="d"
                      Title="Window1" Height="450" Width="800">
    <Grid>

    </Grid>
</local:ExtendedWindow>
Run Code Online (Sandbox Code Playgroud)
namespace Enciphered.Wpf
{
    public partial class Window1 : ExtendedWindow<RoundedWindowViewModel>
    {
        public Window1()
        {
            InitializeComponent();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)
using System.Windows;

namespace Enciphered.Wpf
{
    public class ExtendedWindow<TViewModel> : Window 
        where TViewModel: ViewModel
    {
        protected TViewModel? _viewModel;
        public TViewModel? ViewModel
        {
            get => _viewModel;
            set
            {
                if (_viewModel is not null)
                    if (_viewModel.Equals(value)) …
Run Code Online (Sandbox Code Playgroud)

.net c# wpf

8
推荐指数
2
解决办法
1232
查看次数

IEnumerable <IEnumerable <T >> to string [] []

如何投射IEnumerable<IEnumerable<T>>a string[][]或a List<string[]>

我已经尝试过了.toArray.SelectMany但他们似乎创造了string[]或者List<IEnumerable<string>>不是我真正想要的东西.

c# linq

2
推荐指数
1
解决办法
165
查看次数

标签 统计

c# ×2

.net ×1

linq ×1

wpf ×1