[英]UWP User Controls project type
實際上,我有一些UWP項目,需要重構一些冗余代碼。
在我的GUI中,我有很多次這部分代碼
<ListView ItemsSource="{Binding Model.EstadoValidar.ListaInconsistencias }" Grid.Row="9">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Descripcion}" Height="Auto" TextWrapping="Wrap"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
並且需要將其轉換為Custom控件。
我使用WPF控件庫(.NET Framework)添加了一個名為控件的新項目,該項目無法識別ListView
或GridView
對象。
建立我的客戶控制必須使用哪種項目?
實際上使用VS 2017 15.3,項目目標是.NET 4.6.2 / Standard 1.4
UWP應用程序無法引用WPF Control Library
。 只有WPF應用程序可以。
您不能創建可以在UWP和WPF上使用的自定義控件。 算了吧 UWP和WPF具有無法共享的不同XAML堆棧。
如果要創建可重用的UWP控件,則可以創建一個Class Library (Universal Windows)
項目: http : //www.dotnetcurry.com/windowsapp/930/create-user-control-xaml-csharp
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.