0

xaml内のラベルでToolTipを使用する必要があります

<Page x:Class="xxx.xxx"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
          mc:Ignorable="d" 
          d:DesignHeight="464" d:DesignWidth="628"
        Title="ManagementDetails" Loaded="Page_Loaded">

        <Grid>  
            <Label Margin="0,360,376,91" >
                <ToolTipService.ToolTip>
                      <ToolTip Content="Turtle" />         
                </ToolTipService.ToolTip>
            </Label> 
         </Grid>
    </Page>

このxamlファイルは、別のxamlファイルに含まれるフレーム内の子として使用されます

<Window x:Class="xxx.xxxxxx"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ViewProject" Height="626" Width="810" >
    <Grid  Height="600" Width="800">
        <Frame Margin="172,136,0,0" Name="frame1" />
    </Grid>
</Window>

を使用して、フレーム内にページの xamlファイルを埋め込みました

 MyClass myClass= new MyClass();
frame1.Navigate(myClass);

ToolTip を含むラベルページ xamlファイルからウィンドウxamlファイルに移動すると、 ToolTipは機能しますが、ページ xamlファイル内で使用すると機能しません。

ページの xaml ファイル内で機能させるためにここに欠けているもの

4

3 に答える 3

0

なんでこんなことするの!?!?

次のようなことをしてください:

<Label Name="Some_Label" ToolTip="Turtle"> Fun with labels ...</Label>

終わり。別の内部または単独で動作する必要があります。

于 2013-10-29T23:49:13.457 に答える
0

私のせいで恥ずかしい思いをしているようです。同じページのxamlファイルが重複していて、1つを編集して別の1つを表示していました。ご不便をおかけして申し訳ございません。

于 2013-11-09T22:38:40.120 に答える