0
我有一個列表框,我想要一個彈出控件彈出時,每行onclicked事件我把彈出.xmal但我不能改變isopened =「true」programaticaly在。 CS文件,這裏是我.xmal看起來像無法訪問programaticaly在列表框中的彈出框
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Height" Value="58" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<Grid Name="g2">
<Grid.RowDefinitions>
<RowDefinition Height="27"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<Label Name="lblitemname" Grid.Row="0" Content="Item Name" FontSize="20" FontWeight="Medium" Margin="40,0,0,0" FontFamily="Baskerville Old Face" FontStyle="Italic"/>
<Label Name="lblx" Grid.Row="1" FontSize="11" Content="x" FontWeight="Normal" Margin="50,0,0,-5"/>
<Label Name="lblprice" Grid.Row="1" FontSize="11" Content="50.00" FontWeight="Bold" Margin="60,0,0,-5"/>
<Label Name="lblqty" Grid.Row="1" FontSize="11" Content="5" FontWeight="Bold" Margin="40,0,0,-5"/>
<Label Name="lbltotip" Grid.Row="1" FontSize="11" Content="Rs. 250.00" FontWeight="Bold" Margin="250,0,0,-5"/>
<!--This is popup start-->
<StackPanel Margin="50,0,0,0">
<Popup Name="editpop" PopupAnimation="Slide" AllowsTransparency="True" HorizontalOffset="0" VerticalOffset="0" Placement="Right">
<Canvas Width="600" Height="250">
<TextBlock Canvas.Left="75"
Canvas.Top="28"
Width="500"
Height="200"
Text="Please Enter Your Passcode To Log In"
TextWrapping="Wrapwithoverflow"
FontSize="20"
FontWeight="Bold"
Foreground="White"
/>
<PasswordBox Canvas.Left="60" Canvas.Top="70" Name="txtpwd" Grid.Row="3" Height="60" Width="380" FontWeight="Bold" />
</Canvas>
</Popup>
</StackPanel>
<!--This is popup end-->
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
謝謝你這個方法沒有工作,所以我這樣做了http://www.c-sharpcorner.com/uploadfile/mahakgupta/popup-control-in-wpf/順便再次感謝你試圖幫助我 –
@Dushmantha,在這個網站上,我們更喜歡所有問題都有解決方案。你能否爲你的問題添加一個簡短的答案來描述你的解決方案?這將有助於未來有同樣問題的用戶。一旦你添加了你的答案,請按照本網站上的慣例,[接受它作爲正確答案](http://stackoverflow.com/help/someone-answers)。 – Sheridan