Vusual Studio 2017のWPF,C#で色々試しているのですが
Nugetでインストールした以下のパッケージ?の使用方法が分かりません。
Xamarin.Forms.PinchZoomImage
一応公式サイトの通りに実装してみたのですが、エラーになってしまいました。
-
エラー XLS0503 型 'PinchZoom' の値は、型 'UIElementCollection' のコレクションまたは辞書に追加できません。 WpfApp2 MainWindow.xaml 11
-
エラー XDG0048 指定された値をコレクションに割り当てることができません。次の型の値を指定してください: "UIElement"。 WpfApp2 MainWindow.xaml 11
-
エラー XDG0047 指定された値を割り当てることができません。次の型の値を指定してください: "View"。 WpfApp2 MainWindow.xaml 13
xaml
1//MainWindow.xaml 2<Window x:Class="WpfApp2.MainWindow" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 6 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 7 xmlns:pinch="clr-namespace:Xamarin.Forms.PinchZoomImage;assembly=Xamarin.Forms.PinchZoomImage" 8 xmlns:local="clr-namespace:WpfApp2" 9 mc:Ignorable="d" 10 Title="MainWindow" Height="450" Width="800"> 11 <Grid> 12 <pinch:PinchZoom> 13 <pinch:PinchZoom.Content> 14 <Image Source="D:\aaa.png" /> 15 </pinch:PinchZoom.Content> 16 </pinch:PinchZoom> 17 </Grid> 18</Window>
C#
1// MainWindow.xaml.cs 2 3using System; 4using System.Collections.Generic; 5using System.Linq; 6using System.Text; 7using System.Threading.Tasks; 8using System.Windows; 9using System.Windows.Controls; 10using System.Windows.Data; 11using System.Windows.Documents; 12using System.Windows.Input; 13using System.Windows.Media; 14using System.Windows.Media.Imaging; 15using System.Windows.Navigation; 16using System.Windows.Shapes; 17 18namespace WpfApp2 19{ 20 /// <summary> 21 /// MainWindow.xaml の相互作用ロジック 22 /// </summary> 23 public partial class MainWindow : Window 24 { 25 public MainWindow() 26 { 27 InitializeComponent(); 28 } 29 } 30} 31
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/08/22 14:07