silverlight

Colour selection of Silverlight Toolkit Chart Line Series

喜夏-厌秋 提交于 2020-01-04 02:22:12
问题 I'm working with the Silverlight 4 toolkit and using the Charting control, specifically the Line Series. I'm also using one of the Microsoft Silverlight themes, which comes with some default styling for the Chart. I know that in the ToolkitStyles.xaml there's a whole host of colour brushes that get used by the charting toolkit - ChartBrush1, ChartBrush2 etc. etc.. What I don't understand is how they get used by the chart itself. The reason I'm asking this is because I'm trying to change the

Silverlight/WPF charting toolkit. Can I change frequency of tick marks on CategoryAxis?

情到浓时终转凉″ 提交于 2020-01-04 02:09:27
问题 There is Interval property on LinearAxis but none on CategoryAxis. I need to control frequency of tick marks on X axis. The native logic does so many marks that I cant read even if I stretch the chart across 3 wide monitors!! 回答1: A couple of suggestions... 1.) CategoryAxis has a AxisLabelStyle property which you can use to set in a Style with a smaller FontSize, or a more condensed FontFamily 2.) CategoryAxis also has MajorTickMarkStyle which you can use to set the Line Stroke brush or

How to get real count of a CollectionView, when Filter is in use?

青春壹個敷衍的年華 提交于 2020-01-04 01:57:20
问题 When I have a <Label Content="{Binding ItemCount}"/> on my View to bind to a property on the ViewModel. On the viewmodel I have the property defined as public int ItemCount { get { RowViewModelsCollectionView.Count; } } I am clearly asking for count on the CollectionView , where I am expecting to get the count of only visible items. Unfortunately I get the count of the entire rows, even the ones not showing on the view due the filter. Update: in Ctor: RowViewModelsCollectionView= new

AppManifest Validation failed. Invalid AppPlatformVersion in WMAppmanifest.xml

梦想的初衷 提交于 2020-01-04 01:30:10
问题 I recently upgraded my WP8 Silverlight Application to 8.1 Silverlight. But now, ehwn building I always get this error message AppManifest Validation failed. Invalid AppPlatformVersion in WMAppmanifest.xml Bedtime Music What went wrong and how can I fix this. Thanks 回答1: Nah, I found out by myself: In the WMAppmanifest file there is this line: <Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0"> To deal with the resulting error that occurs

C#: passing parameters to callbacks

匆匆过客 提交于 2020-01-03 22:31:15
问题 I have a fairly generic class (Record) that I have added a callback handler to, so I can do something like the following. record.Save(AfterSaveMethod); Which also returns the identity number of the record created. The issue I have now is that I have this nested save routine in a loop, and I need to use/pass the i variable! for (int i; i < count ;i++) { record.Save(AfterSaveMethod2) //but I need to pass i through as well } What do I do here? A\ rewrite the save method and include it in this

C#: passing parameters to callbacks

十年热恋 提交于 2020-01-03 22:28:46
问题 I have a fairly generic class (Record) that I have added a callback handler to, so I can do something like the following. record.Save(AfterSaveMethod); Which also returns the identity number of the record created. The issue I have now is that I have this nested save routine in a loop, and I need to use/pass the i variable! for (int i; i < count ;i++) { record.Save(AfterSaveMethod2) //but I need to pass i through as well } What do I do here? A\ rewrite the save method and include it in this

ArgumentOutOfRangeException when replacing items in an ObservableCollection<T>

感情迁移 提交于 2020-01-03 21:14:52
问题 I'm working on a Refresh() extension method for ObservableCollection which adds, removes or replaces items based on a matching key (this means when bound to a DataGrid the grid doesn't re-scroll and items don't change their position unless they were removed). Problem is when I replace items in the ObservableCollection the last item throws an ArgumentOutOfRangeException, what am I missing here? public static void Refresh<TItem, TKey>(this ObservableCollection<TItem> target, IEnumerable<TItem>

UIElement.ClipToBounds is in WPF but not Silverlight. How to simulate in Silverlight?

余生长醉 提交于 2020-01-03 19:33:13
问题 I have a Canvas in WPF and I want to prevent its children from being drawn outside the edges of the Canvas ara. In WPF this is simple as you just set the ClipToBounds property on the Canvas to True and it does as expected. Porting the sample XAML to Silverlight there is an issue because ClipToBounds does not exist! Is there a way to simulate this functionality? I am happy to derive from Canvas and override the Measure/Arrange methods if needed. 回答1: I found the solution myself. Override the

How do I set a minimum width and height for my Silverlight 4 OOB application?

此生再无相见时 提交于 2020-01-03 18:59:09
问题 Is there a way to set a minimum width and height for my Silverlight 4 out-of-browser application? 回答1: There are no built in settings to control the window Minimum Width and Height so you will need to handle it with code. First of all your OOB app needs to have Elevated Trust. You then need to attach a handler the SizeChanged event of the FrameworkElement being used for the application's RootVisual (usually MainPage.xaml). In the handler include code like this:- if (Application.MainWindow

Require credentials for some methods only in WCF web service

孤者浪人 提交于 2020-01-03 18:54:25
问题 I have a UserAccountService with different methods, some of which require the user to be authenticated (e.g. ChangePassword, ChangeUserData) and some not (RegisterUser). However it seems I can't seem to get it to work, so that only some methods require authentication. The methods that require authentication are decorated with [PrincipalPermission(SecurityAction.Demand, Authenticated = true)] In my app.config I have a binding specified which uses encryption and requests UserName credentials: