|
Pete's answer:
Pete wrote: The issue is that resources that are in or consumed in a control template have to be frozen. This is done so that the resource can be shared across control instances quickly. Once you set the binding on the Dependency Object on a Freezable, you stop it from being frozen.
As you can't create a static resource of the RepeatBehavior, I'd suggest that this is one of those instances where it is perfectly legitimate to have code in the code behind of the view. Don't tie yourself into logical knots here - view specific code in the view code-behind is legitimate.
Greetings - Jacek
|
|
|
|
|
|
Hi All,
I am a newbie in Silverlight. We are using WCF services and Stored Procs. I would like to implement custom pagination using Datapager(the look and feel) and WCF services. I would like to pull only the required rows from the db. Can this be achieved using just the WCF services and not the WCF RIA services?
I have browsed through the web and learned that it can be achieved in 2 ways
1. WCF RIA services, DomainServices, DomainDataSource
2. Custom Pagination using own controls and not using DataPager.
I dont want to use both of these approaches.
Kindly let me know if there is any other alternative to achieve this using the DataPager and WCF Services.
Thanks a Ton...
|
|
|
|
|
I hate to supply a search for such a well placed question but there seems to be a number of solutions out there based on sql server data paging[^]
What you are describing is paging implemented at the database level rather than the DAL or UI layers. Caveat I have never used paging - ever so my experience is rather limited.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how i can set & get pixel of image in wpf application(C#)?
|
|
|
|
|
|
I need to sort the items in autocompletebox. It has binding to an observable collection of strings.
With a combobox I used the Items.SortDescriptions but this does not work for the ACB.
I tried the following but cant find the listbox property name
//lst = acb1.Template.FindName("SelectionAdapter", acb1) as ListBox;
// if (lst != null)
// lst.Items.SortDescriptions.Add(sd);
So what is the best way to do it please?
|
|
|
|
|
Moonwalker031 wrote: It has binding to an observable collection of strings.
Sort the observablecollection before binding.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well I tried myobscol.orderby(x=>x) but did not work.
I am adding and removing items from the list during execution so would like an automatic sort instead of sorting manually each time.
|
|
|
|
|
You are manipulating the list "manually" when you insert/remove items, why can't you sort it then.
Do some research on sorting observablecollections.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ok solved.
When I searched for sorting Observable collection I read that I had to create another copy of the list which I was trying to avoid.
I inserted the line below after adding items to the list. This should not create unnecessary lists.
acb1.ItemsSource = myobscol.OrderBy(x => x);
Back to the first post. What is the name of the Listbox property in the Autocomplete box? I still need this for somthing else.
ListBox lst = acb1.Template.FindName("SelectionAdapter", acb1) as ListBox;
This does not work and gives a null. I tried "ListBox" and "ItemContainerStyle" but still got a null.
|
|
|
|
|
Rather than manipulating your ObservableCollection, take a look at using CollectionViewSource instead. This provides the ability to sort and filter collection items any which way you want.
|
|
|
|
|
Thanks I came across the CollectionViewSource already. But since my project is almost complete and based on Observable collection I didn't want to change everything.
Anyway now the sorting is solved and working properly (see previous post).
|
|
|
|
|
Hi,
In my application on clicking a link i m opening an aspx page in different IE window.Now I want to display "Loading..." on the parent IE window's status bar untill the new window opens when the link is clicked.
|
|
|
|
|
Try HtmlPage.Window.SetProperty("defaultStatus", "Loading..."); .
However, note this is only for IE.
I'm not sure what you need to do for Firefox or other browsers.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
You are welcome. Vote or mark as answered if this answer helped though.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
modified on Tuesday, March 15, 2011 8:05 AM
|
|
|
|
|
I'm curious. Why vote the answer? Surely a better indication would be to mark the answer as SOLVED. That's what these forums are about after all.
|
|
|
|
|
Yes. Fair enough.
'Mark as answered' is still relatively new so I keep forgetting about it.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Abhinav S wrote: 'Mark as answered' is still relatively new so I keep forgetting about it
Fair enough. When you don't ask many questions, but rather spend all your time answering them, it's an easy one to forget.
|
|
|
|
|
I dont know how to use Linq in Silverlight 4.0
I add it into Project.Web but it useless
PLease help me. Thanks
(I dont good at English. But i can read. Thanks )
|
|
|
|
|
You can use LINQ in Silverlight pretty much the same way you use it in C#.
Do you mean LINQ to XML etc?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Are you trying to execute a Linq to SQL query from Silverlight? If you are, then you can't do this. What you should do is investigate the RIA services that Silverlight uses - google for Silverlight RIA to get an understanding of how to use them.
|
|
|
|
|
I' curious Pete, do YOU use the RIA services, I don't as I like to roll my own but I'm interested to know if some of the more exprerienced devs here use things like RIA or EF.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I do use RIA and EF. I don't do much with RIA because my primary focus is desktop development, but I've done a fair bit with EF since version 2. V5 looks to be quite decent. While I like to roll my own code, as much as the next man, there comes a point where I have to look at the investment cost and think that using something that somebody else has built may be cheaper. There are lots of factors that go into my decision on that topic.
|
|
|
|