|
Hi,
I am facing the similar kind of issue. But I am actually changing the controTemplate of ListBoxItem itself with ContentPresenter & a TextBox.
Did the same thing as per the posted contents but it did not work with the binded list. I have given something like below in the ControlTemplate of ListBox Item.
<contentpresenter x:name="displayTextBlock" grid.column="0" grid.columnspan="1" margin="11,5,11,5" horizontalalignment="Stretch">;
<textbox x:name="listItemTextBox" padding="11,5,11,5" horizontalalignment="Stretch"
="" background="Transparent" grid.column="0" visibility="Collapsed" grid.columnspan="1" text="{Binding Path=Content, ElementName=displayTextBlock, Mode=TwoWay, UpdateSourceTrigger=LostFocus}">
Kindly suggest.
|
|
|
|
|
You code did not come through.
|
|
|
|
|
See if it appears perfectly now..
Hi,
I am facing the similar kind of issue. But I am actually changing the controTemplate of ListBoxItem itself with ContentPresenter & a TextBox.
I did the same thing as per the posted contents but it did not work with the binded list. I have given something like below in the ControlTemplate of ListBox Item.
<ContentPresenter x:Name="displayTextBlock" Grid.Column="0" Grid.ColumnSpan="1" Margin="11,5,11,5" HorizontalAlignment="Stretch"/>
<TextBox x:Name="listItemTextBox" Padding="11,5,11,5" HorizontalAlignment="Stretch"
Background="Transparent"
Grid.Column="0"
Visibility="Collapsed" Grid.ColumnSpan="1"
Text="{Binding Path=Content, ElementName=displayTextBlock, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
Kindly suggest.
Thnx,
Ritesh
|
|
|
|
|
It won't work because you are binding the TextBox to the ContentPresenter. There is no binding to your data element at all.
|
|
|
|
|
This is a custom control. In window, ItemSource of this control is bind to a collection Object. Do you suggest some other approach for this.
|
|
|
|
|
But you have not bound any property of the collection to the ListBox item. How do you expect the collection to change?
|
|
|
|
|
Hi,
We are doing the binding as below:
<eclp:EclpList Name="eclpList" Margin="5" Height="Auto" Width="100" ItemsSource="{Binding}" DisplayMemberPath="Name" SelectionChanged="cmb_SelectionChanged" />
See if this can give any ideas..
Thnx
Ritesh
|
|
|
|
|
Actually TextBox will be hidden & will be visible on DoubleClick. At that time, I want the content of ListBox item to be modified in Textbox & after lostfocus of TextBox, it should update ListBox Item & again becomes hidden.
This works for unbound list but for bound list, I need your suggestions.
|
|
|
|
|
You should try something like this Link[^]
|
|
|
|
|
Hi,
I am facing the similar kind of issue. But I am actually changing the controTemplate of ListBoxItem itself with ContentPresenter & a TextBox.
I did the same thing as per the posted contents but it did not work with the binded list. I have given something like below in the ControlTemplate of ListBox Item.
<ContentPresenter x:Name="displayTextBlock" Grid.Column="0" Grid.ColumnSpan="1" Margin="11,5,11,5" HorizontalAlignment="Stretch"/>
<TextBox x:Name="listItemTextBox" Padding="11,5,11,5" HorizontalAlignment="Stretch"
Background="Transparent"
Grid.Column="0"
Visibility="Collapsed" Grid.ColumnSpan="1"
Text="{Binding Path=Content, ElementName=displayTextBlock, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
Kindly suggest.
Thnx,
Ritesh
|
|
|
|
|
Hi,
I'm trying WPF and databinding....and I've run into a simple(I suppose) problem. Hopefully someone cam point me in the right direction.
If I declare a double like this i window.resources:
<System:Double x:Key="myValue">10</System:Double>
How can I bind a textboxs textproperty to it?
|
|
|
|
|
Here's a sample:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
>
<Page.Resources>
<System:Double x:Key="myValue">10</System:Double>
</Page.Resources>
<Grid>
<TextBox Text="{Binding Source={StaticResource myValue}, Mode=OneWay}" />
</Grid>
</Page>
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Thank you very much, but how about TwoWay binding? Why doesnt that work? If I create a simple class and have a property of type double and bind to that property it works fine.
|
|
|
|
|
It won't work in this sample because you don't have a variable backer to bind into - it's a StaticResource. If you had a variable the two way binding would work.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Hmmmm....I've probably missunderstood something here....
I thought that I declared a variable, but it looks lite I can treat these declarations as "const"s....
How about DynamicResource, can I use that instead?
|
|
|
|
|
hi all,
with Silver3.0 can we use managed VC++ Dll or C# Dll as we can can use in WPF
using HndHost??
Thanks in Advance
Samir Satardekar
|
|
|
|
|
The requirements will be the same - you can use any .NET assembly
that targets the Silverlight .NET framework library.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Sir Mark,
I have created a Dll using VC++ and build it with clr option. i add the following lines
to access it in my C# forms
namespace a
{
public ref class b
{
public: void funccall()
{
//call to class
}
}
};
can i use this dll in my silverlight project??
i have tried the convert .net assembly to silverlight Assembly
Converting .NET Assemblies to Silverlight Assemblies[^]
This does work for VC# dlls but fails for VC++
Thnks in Advance..
Regards
Samir
|
|
|
|
|
In theory you could use a C++/CLI DLL in Silverlight but you'd
have to do the following:
Compile with /clr:pure
Eliminate all references to .NET framework assemblies
Only reference Silverlight framework assemblies
Eliminate any use of the CRT (C runtime)
At that point you essentially have C# so you're not getting any benefit from C++.
Even if you do all of the above, I've heard it still won't work properly
because the MSIL produced by the C++ compiler has some incompatibility with
the Silverlight "runtime".
Give it a try if you want, but it's currently not supported.
Just use C#
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I want to know the Exact use and purpose of Windows Workflow Foundation?
i gone through many articles, in that they explain their own examples only but no one describe about WF and WF uses.
Please Explain Purpose of WF.
Please dont give links, In that they explain with an example only.
Thanks In Advance.
--Naren
|
|
|
|
|
Like its bastard cousin (WPF), it's main purpose is to slow development to a crawl while you search in vain for answers to your inevitable questions. If and when you ever get your application finished, its secondary purpose kicks in, obfuscating the programs intended purpose and making maintenance more difficult because Microsoft abandoned the framework soon after introducing it (like they're doing to LINQ, and soon, WPF).
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: because Microsoft abandoned the framework soon after introducing it (like they're doing to LINQ, and soon, WPF)
Where did you read that?
Kevin
|
|
|
|
|
I read a blog somewhere today that said Microsoft was pushing silverlight and would soon abandon WPF.
Don't ask me where, because I don't recall (and thought it was kind of absurd myself).
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
I know I don't have to state this, but I will anyway -
Silverlight can't replace WPF - they aren't even the same "technologies".
So your frustrations with learning a new framework (which I bet you'll soon
find much more flexible than Windows Forms) has led you to rehashing garbage
you read on the internet?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tend to lash out at any moving object when I'm pissed off.
Of course, I know that silverlight can't replace WPF, but we all know about Microsoft's tendency toward platform/framework/paradigm abandonment, so I figured I'd ping on it.
"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." - Jason Jystad, 10/26/2001
|
|
|
|