This is my very simple Accordion XAML :-
<toolkit:Accordion Grid.Column="1" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" SelectionMode="OneOrMore" MinHeight="500">
<toolkit:AccordionItem Header="Welcome" Margin="10,0" IsSelected="True" />
<toolkit:AccordionItem Header="Family news" Margin="10,0" />
<toolkit:AccordionItem Header="Random photos" Margin="10,0" />
<toolkit:AccordionItem Header="News articles" Margin="10,0" />
</toolkit:Accordion>
If I click few times on the accordion item very fast I get this exception :-
AccessViolationException
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Can anybody tell me what is wrong with this?
Thanks in advance :)
Install latest Toolkit..
http://silverlight.codeplex.com/releases/view/43528#DownloadId=117046
Then create new project. Add Accordion control on it... try to repit the error..
PS: I don't think this is an accordion fault... Accordion work just fine...
Related
I am writing a plugin for Hearthstone Decktracker, and am adding a tooltip to each of the items that get generated in an ItemsControl.
If I attach the debugger to HearthstoneDeckTracker, I can see the items have a tooltip in the VisualTree, but the tooltip never shows when I mouseover the item.
If anyone were able to help with this problem, it would require that they have HDT and Hearthstone, but I feel the problem is more of a WPF issue than a DeckTracker issue.
There are instructions on creating a plugin at https://github.com/HearthSim/Hearthstone-Deck-Tracker/wiki/Creating-Plugins
To replicate this, you could use the example project provided by HDT Github at https://github.com/andburn/hdt-plugin-example.
Adding a tooltip to the DataTemplate in CurvyList.xaml should be able to show you what I am seeing.
Instead of
<DataTemplate>
<Rectangle Fill="{Binding Background}" Height="34" Width="217" />
</DataTemplate>
you would have (sorry... doing this off top of my head, so syntax may be incorrect)
<DataTemplate>
<Rectangle Fill="{Binding Background}" Height="34" Width="217" >
<Rectangle.Tooltip>
<Textblock Text="Hello World" />
</Rectangle.Tooltip>
</Rectangle>
</DataTemplate>
I have posted this same question on the official Discord channel, but I don't think it is currently being viewed, so I am going to give it a shot here.
Any help would be greatly appreciated! Thanks in advance.
cannot you just add the tooltip directly into the rectangle?
<DataTemplate>
<Rectangle Fill="{Binding Background}" ToolTip="Hello World" Height="34" Width="217" />
</DataTemplate>
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1">
<TextBlock Text="{x:Static meta:MetaCommon.Returned}" Style="{StaticResource SectionHeader}" Margin="0,0,0,10" />
<TextBlock Text="{x:Static meta:MetaCommon.Date}" Style="{StaticResource ContentHeader}" />
<DatePicker TabIndex="10" HorizontalAlignment="Left" MinWidth="200" Margin="0,0,0,10" />
<TextBlock Text="{x:Static meta:MetaCommon.Time}" Style="{StaticResource ContentHeader}" />
<materialDesign:TimePicker TabIndex="11" HorizontalAlignment="Left" Width="200" materialDesign:HintAssist.Hint="" Margin="0,0,0,0" />
</StackPanel>
So the TabIndex works properly for everything except TimePicker. It will just skip to the next TabIndex. I'd like it to tab to the TimePicker in the proper order.
I'm not sure what the issue is because I've tried various ways and it just doesn't follow the tab order I set. The only time it gets selected is if I keep "tabbing" through the controls it eventually gets selected.
I tried setting a TabIndex of both "0" and "1" and I tried setting TabStop to both "True" and "False" but nothing seems to work apart from continuous tabbing and hoping it gets selected.
I even tried setting it in the code behind to just to make sure.
As far as I can gather, it could be that, because it is a part of the Material Design XAML Toolkit, it doesn't support direct TabIndex like native controls.
I know this is going to sound really stupid but is there anything I'm missing because I have a simple page in my windows 8.1 phone app with a checkbox and a button. I can click on the button just fine in the emulator but I can't get the checkbox to check or uncheck at all. I feel really stupid for not being able to do something this simple. Am I missing something here?
<Grid>
<TextBlock Name="lblTermsofAgreement"/>
<CheckBox Name="chkAcceptTerms" Checked="chkAcceptTerms_Checked" Click="chkAcceptTerms_Click" Unchecked="chkAcceptTerms_Unchecked" HorizontalAlignment="Center" Content="I accept the terms of agreement" VerticalAlignment="Center" IsEnabled="True"></CheckBox>
<TextBlock Name="lblTermsError" FontFamily="Red" Text="" />
<Button Name="btnAccept" Click="btnAccept_Click" Content="Accept" HorizontalAlignment="Center" VerticalAlignment="Bottom"></Button>
</Grid>
All the controls are in row 0 column 0 for the grid so there was a control on top of it preventing it from getting checked. I would either add rows to the grid and set there rows or put the controls in a stack panel.
<Grid>
<StackPanel>
<TextBlock Name="lblTermsofAgreement"/>
<CheckBox Name="chkAcceptTerms" HorizontalAlignment="Center" Content="I accept the terms of agreement" VerticalAlignment="Center" IsEnabled="True"></CheckBox>
<TextBlock Name="lblTermsError" FontFamily="Red" Text="" />
<Button Name="btnAccept" Content="Accept" HorizontalAlignment="Center" VerticalAlignment="Bottom"></Button>
</StackPanel>
</Grid>
I’d like to find out if I am missing something in my XAML code related to the tabbing. In my case, I need to click twice to be able to advance to the next control in the tab order. It will be great to find out the proper way applying tabbing in Silverlight 4. Below is the code I use for tabbing. Thank you in advance!
<StackPanel x:Name="sp" Grid.Column="0" >
<TextBlock x:Name="txtO" Style="{StaticResource AVV_TitleStyleBlue}" Text="Text" />
<HyperlinkButton x:Name="hl1" Style="{StaticResource AVV_HyperlinkButtonStyle}" Content="test 1" IsTabStop="True" TabIndex="11" />
<HyperlinkButton x:Name="hl2" Style="{StaticResource AVV_HyperlinkButtonStyle}" Content="test 2" IsTabStop="True" TabIndex="12"/>
<HyperlinkButton x:Name="hl3" Style="{StaticResource AVV_HyperlinkButtonStyle}" Content="test 3" IsTabStop="True" TabIndex="13" />
<HyperlinkButton x:Name="hl4" Style="{StaticResource AVV_HyperlinkButtonStyle}" Content="test 4" IsTabStop="True" TabIndex="14" />
</StackPanel>
You might have the issue where a sub control is also getting the tab, i guess that since you need to tab twice. On the first tab is most likely taking you to a hidden control, The second tab then takes you to the control you want. To fix this you need to find out what control the focus is going to when you hit Tab. You can do that by using the Focus Manager's get Focused Component method; you put that in a place just after you hit tab, you may need a small delay before getting the control. Then you set a break point in VS, and get the info about that control. Once found you set its IsTabStop Property to false. If you are using a third party control, you will need to change its template maybe using expression blend.
In Silverlight 4 application there are few images, both are displayed correctly in design mode, one is displayed correctly in run-time also:
<Image Height="180" Width="149" Source="../Picts/Field.png" />
Another one is not displayed in run-time:
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5" Visibility="{Binding SquadSavedVisibility, Mode=OneWay}">
<Image Source="..\Picts\ok.png" Width="16" Height="16" />
<TextBlock Text=" It is saved" Foreground="Green"/>
</StackPanel>
Why? And how to get it displayed?
Any thoughts are welcome. Thanks.
It's all in your slashes, VS Design time doesn't mind you using "..\Picts\ok.png", but Silverlight runtime wants to see "../Picts/ok.png". In other words, your slashes matter.
I had a similar problem with images showing in design-time, but not at runtime. Mine was using a pack URI so I wanted to post that fix as well:
Does not work at runtime, does work at design-time:
<Image Source="mydllname;component/Images/logo.png" />
Works at both design and runtime:
<Image Source="/mydllName;component/Images/logo.png" />
Note the extra '/' before the Pack URI starts.
You can try to hook into the Image.ImageFailed Event. For examples and more explanation you look into this page:
http://msdn.microsoft.com/en-us/library/system.windows.controls.image.imagefailed%28v=VS.95%29.aspx