|
well generally a control template is applied if you want change the appearance of a Control. Its just that a control's visual tree is changed. Like for a rounded button, we have to replace the button with a border with a specified corner radius and then provide some animation(storyboard) to make it feel like a Button and still it will be having the Click event!
|
|
|
|
|
Remove Height and Width from Textbox, so that it takes the same from the Border.
It should work fine.
-
Bits and Bytes Rules!
10(jk)
|
|
|
|
|
i want to write some control that will contain 2 button and listView.
Pressing button 1 will scroll the listview up.
Pressing button 2 will scroll the listview down.
The direct scroll of the listview will be unavailable - ( will be invisible ? ).
1. I don't find the listview method 'scroll-up' / 'scroll-down' that i could callon the button event.
2. How can i make the listview scroll to be always visible ?
Someone can help me here ?
Thanks.
|
|
|
|
|
One way to do this is to get the ScrollViewer inside the ListView. In the following sample, I demonstrate how to get the scroll viewer of a ListView called myListViewInstance.
public static T FindChild<T>(DependencyObject child) where T : FrameworkElement
{
if (child.GetType() is typeof(T)) return child;
for (int count = 0; count < VisualTreeHelper.GetChildrenCount(child); count++)
{
var childItem = VisualTreeHelper.GetChild(child, count);
var result = FindChild(childItem);
if (result == null) continue;
return result;
}
return null;
}
private ScrollViewer _instanceViewer;
private void ScrollUp()
{
if (_instanceViewer == null)
_instanceViewer = FindChild<ScrollViewer>(myListViewInstance);
if _instanceViewer == null) return;
_instanceViewer.LineUp();
}
private void ScrollDown()
{
if (_instanceViewer == null)
_instanceViewer = FindChild<ScrollViewer>(myListViewInstance);
if _instanceViewer == null) return;
_instanceViewer.LineDown();
}
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Are you looking for this[^]?
|
|
|
|
|
That is some kick ass Post you got Kunal.
Uday
|
|
|
|
|
|
AFAIK there is not.
However, after elevating your project to full trust in SL4, you can use some of .Net's built in classes.
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hi Sri Abhinav,
Hope this is not too OT: but: what are the implications of elevating a project to full trust in SL4 for end users who deploy the appplication ?
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Found this[^] intersting article that might be a good read if you've not come across it before.
"Although trusted applications do not have full access to the host computer, they can access personal data and potentially cause harm. Therefore, you should treat them as full-trust applications when you perform security evaluations and audits. To prevent users from installing or running trusted applications, system administrators can use machine policy settings to deny access, as described in the "Policy Restrictions for Elevated Trust" section of this topic."
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hi everyone!
Has anyone worked with QR barcode using WPF? Is there a free library for Wpf?
modified on Tuesday, November 23, 2010 2:43 PM
|
|
|
|
|
Big blinking stock trading screens - would you recommend WPF?
Note, i'm fully aware of this article[^]
But, from my own experience, as well as from experience from other guys who do demanding apps, that WPF is slow.
dev
|
|
|
|
|
In my experience, WPF is nice and quick, as long as you have a decent computer... It takes advantage of your GPU for rendering, so it's better if you have a decent video card (Not talking a gaming machine - Just something that's not completely obsolete).
Sure, C++ would be faster, but that's always true.
(Context: I write portfolio management software for a hedge fund in C#/WPF)
|
|
|
|
|
(Context: I write portfolio management software for a hedge fund in C#/WPF)
yes, buy side apps less demanding than blinking day trades apps (whether pricer with real time analytics or just trades with pnl)
I suspect primary cause we access the app through Xenapp - I hear each scroll is equivalent to wiring down a bitmap! so, even with a grid with few hundred records it's a little laggy.
dev
|
|
|
|
|
Not familiar with Xenapp, but I'm going to guess that's some kind of remoting setup...
If the graphics were being handled on the client side, it would be nice and quick... But if you're sending the graphics down the pipe, you'll never get the performance you want. If I were you, I'd start looking into any known issues with Xenapp and WPF... Maybe there's a way to get it to properly render the graphics on the client side.
|
|
|
|
|
The problem here, isn't WPF, it's the use of virtual application environment. It's unfair to label WPF as unresponsive when the whole underlying delivery mechanism is the cause. It's like blaming some guy sitting in the stands for Alonso not winning F1 this season.
|
|
|
|
|
Web based page - then try Silverlight.
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
most of these apps are client server apps done in WIN32
if WPF don't cut it, unlikely Silverlight will
Again, from different friends from big firms I know both WPF and Silverlight are choosen but some disappointment as apps not as snappy as one would expect.
dev
|
|
|
|
|
I'm tryin to define this namespace:
xmlns:my="clr-namespace:MyProject"
And while intellisense says it's there ("MyProject in assembly MyProject"), after I accept it from the intellisense box, the namespace gets underlined and I get an intellisense error stating that the namespace can't be found.
WTF?!
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Possibly a stupid suggestion, but have you built the project yet?
The XAML designer doesn't pick up on stuff like that until it's been built.
EDIT: Oh, and if that doesn't do it, try appending ";assembly=MyProject" to tell it exactly where to look... Silverlight tends to be a lot more picky than WPF.
|
|
|
|
|
I tried that, and "assembly=" with nothing specified after the = operator.
Everything is in the same assembly. I tried removing the affected files from the project, compiling, and adding them back, and still no joy.
The part that pisses me off is that under C#, all this stuff compiled and oworkled just fine.
I wonder if this crap has something to do with infer and strict project settings...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Ah, so it's a VB thing... I didn't think it would be any different from C#, since the XAML side should be pretty much the same.
|
|
|
|
|
Well, I tried playing with the options, and nothing changed.
I don't understand why there is a namespace issue under VB, but not under C#...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hmm, might have something here: http://www.paulstovell.com/wpf-vbnet-xaml[^]
Is MyProject your root namespace? Looks like C# is smart enough to figure out a relative namespace, but VB.NET isn't, so you have to specify the whole thing.
|
|
|
|
|
I ended up having to re-add all the offending code by hand, and it appears to be fine so far. Keep in mind that I am not making any changes to the code - I'm creating the new objects by hand, and then copy/pasting from the original project.
I hate VB...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|