0
나는 텍스트 및 이미지 content.I을 확장 할

는 같은 출력하고자uwp에서 텍스트와 이미지를 어떻게 스케일 할 수 있습니까?</p> <p><img src="https://i.stack.imgur.com/kH3o6.jpg" alt="I want an output like that"></p> <p>을하지만 그 같은 결과 :

Current out put like that

내 코드는 다음과 같습니다. 문제가 무엇입니까?

<UserControl.Resources> 
     <DataTemplate x:Key="ImageTemplate" x:DataType="model:NoteBlock">  
      <Grid> 
       <Viewbox Stretch="UniformToFill" StretchDirection="Both" Grid.Row="0"> 
        <ScrollViewer MinZoomFactor="1" MaxZoomFactor="3" VerticalScrollMode="Disabled" HorizontalScrollMode="Disabled"> 

         <Image HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
         Margin="0" Source="{x:Bind BlockData}" Holding="Image_Holding" PointerPressed="Image_PointerPressed" /> 
        </ScrollViewer> 
       </Viewbox> 
      </Grid> 

     </DataTemplate> 
     <DataTemplate x:Key="TextTemplate" x:DataType="model:NoteBlock"> 
      <Grid> 
       <Viewbox StretchDirection="Both" Stretch="Uniform" VerticalAlignment="Top"> 
        <RichEditBox Name="richEditor" BorderThickness="0" l:RtfText.RichText="{x:Bind BlockData}" Margin="0" GotFocus="richEditor_GotFocus" > 
        </RichEditBox> 
       </Viewbox> 
      </Grid> 
     </DataTemplate> 
     <DataTemplate x:Key="GapTemplate"> 
      <Grid Height="20" > 
      </Grid> 
     </DataTemplate> 

     <l:NoteTypeTemplateSelector x:Key="NoteTypeTemplateSelector" 
     TextTemplate="{StaticResource TextTemplate}" 
     ImageTemplate="{StaticResource ImageTemplate}" 
     GapTemplate="{StaticResource GapTemplate}"></l:NoteTypeTemplateSelector> 
    </UserControl.Resources> 

    <Grid Name="ContainerGrid" Background="White" PointerPressed="ContainerGrid_PointerPressed" > 
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"></RowDefinition> 
      <RowDefinition Height="*"></RowDefinition> 
     </Grid.RowDefinitions> 

     <ToggleSwitch Margin="0" Name="Mode" HorizontalAlignment="Right" OffContent="Read Mode" OnContent="Edit Mode"></ToggleSwitch> 

     <ListView x:Name="NoteList" Background="Transparent" 
        Grid.Row="1" 

        ItemsSource="{x:Bind ds}" 
        ItemTemplateSelector="{StaticResource NoteTypeTemplateSelector}" 
        ScrollViewer.VerticalScrollMode="Enabled"> 
      <ListView.ItemContainerStyle> 
       <Style TargetType="ListViewItem"> 
        <Setter Property="Template"> 
         <Setter.Value> 
          <ControlTemplate> 
           <ContentPresenter/> 
          </ControlTemplate> 
         </Setter.Value> 
        </Setter> 
       </Style> 
      </ListView.ItemContainerStyle> 
     </ListView> 
     <SwapChainPanel Name="DxPanel" Grid.Row="0"></SwapChainPanel> 
    </Grid> 
</UserControl> 

도와 주시겠습니까?

+1

문제를 재현 할 수있는 [mcve]를 공유 할 수 있습니까? 게다가 정확히 무엇을 달성하고 싶습니까? 코드에서 크기를 설정하지 않았습니다. – ZORRO

답변