Click here to Skip to main content
15,885,309 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Starting to hate silverlight Pin
lepipele8-Oct-09 18:01
lepipele8-Oct-09 18:01 
QuestionHow to show SSL WCF Service Padlock Pin
Soulforged8-Oct-09 13:48
Soulforged8-Oct-09 13:48 
AnswerRe: How to show SSL WCF Service Padlock Pin
Nigel Ferrissey8-Oct-09 14:22
Nigel Ferrissey8-Oct-09 14:22 
GeneralRe: How to show SSL WCF Service Padlock Pin
Soulforged8-Oct-09 15:31
Soulforged8-Oct-09 15:31 
GeneralRe: How to show SSL WCF Service Padlock Pin
Nigel Ferrissey8-Oct-09 16:15
Nigel Ferrissey8-Oct-09 16:15 
GeneralRe: How to show SSL WCF Service Padlock Pin
Soulforged8-Oct-09 16:49
Soulforged8-Oct-09 16:49 
GeneralRe: How to show SSL WCF Service Padlock Pin
Nigel Ferrissey8-Oct-09 18:07
Nigel Ferrissey8-Oct-09 18:07 
QuestionDynemic Data binding for image within ListBox Pin
grvdarji8-Oct-09 10:40
grvdarji8-Oct-09 10:40 
Hi,

I am working on a WPF application,
one of my wpf windows has Listbox -> stackpanel -> Image and text block.

Let me put my xaml for better understanding

------------------------
<ListBox Name="listboxImage" HorizontalContentAlignment="Center" DataContext="Binding Element=listBinding,Path=SelectedItem" SelectionChanged="listboxImage_SelectionChanged"><!-- --><br />
                        <ListBox.ItemTemplate><br />
                            <DataTemplate x:Name="dtTemplate"><br />
                                <StackPanel Orientation="Vertical" Name="stackpnl"><br />
                                    <Image Name="imagelisted" Source="C:\Casket.png"/> <br />
                                    <TextBlock Name="textblockProductID" Text="{Binding Path=ProductID}"/><br />
                        </StackPanel><br />
                            </DataTemplate><br />
                        </ListBox.ItemTemplate><br />
                    </ListBox>

----------------------
Here is what I am trying to do behind the scene
-----------------
Binding listBinding = new Binding();<br />
                listBinding.Source = ds.Tables[0];<br />
                listboxImage.SetBinding(ListBox.ItemsSourceProperty, listBinding);<br />
                listboxImage.SelectedIndex = 0;<br />
               <br />
                byte[] bytes = (byte[])ds.Tables[0].Rows[0][1];<br />
<br />
                MemoryStream stream = new MemoryStream();<br />
                stream.Write(bytes, 20, bytes.Length - 20);<br />
<br />
<br />
                PngBitmapDecoder decoder = new PngBitmapDecoder(stream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);<br />
                ImageSource source = decoder.Frames[0];<br />
<br />
                this.imageTest.Source = source;

-----------------

Please, note that imageTest is the TestImage I have put outside the listbox, which works fine.

Now, Of course I am not setting Image's Source property "???????" but, in place of that
I want to set that property dynemically form code, as I am twicking the byte[] field.

So again, my question is how can I set source property to something from the code?

I have object of ImageSource ready,
So all I have to do is my "(from ListBox)ImageName.Srouce = myobject Of ImageSource Type.

I am new to WPF and DataBinding with it.
AnswerRe: Dynemic Data binding for image within ListBox Pin
Gideon Engelberth9-Oct-09 3:32
Gideon Engelberth9-Oct-09 3:32 
GeneralRe: Dynemic Data binding for image within ListBox Pin
grvdarji9-Oct-09 6:20
grvdarji9-Oct-09 6:20 
GeneralRe: Dynemic Data binding for image within ListBox Pin
Gideon Engelberth9-Oct-09 13:25
Gideon Engelberth9-Oct-09 13:25 
Questionround slider Pin
robotz8-Oct-09 4:57
robotz8-Oct-09 4:57 
AnswerRe: round slider Pin
Christian Graus8-Oct-09 9:41
protectorChristian Graus8-Oct-09 9:41 
GeneralRe: round slider Pin
robotz8-Oct-09 9:58
robotz8-Oct-09 9:58 
GeneralRe: round slider Pin
Christian Graus8-Oct-09 10:26
protectorChristian Graus8-Oct-09 10:26 
GeneralRe: round slider Pin
robotz8-Oct-09 10:32
robotz8-Oct-09 10:32 
QuestionMedia element fullscreen Pin
Nekkantidivya7-Oct-09 19:29
Nekkantidivya7-Oct-09 19:29 
AnswerRe: Media element fullscreen Pin
Nigel Ferrissey8-Oct-09 16:03
Nigel Ferrissey8-Oct-09 16:03 
QuestionCalling SSL WCF Service from Silverlight Pin
Soulforged7-Oct-09 15:47
Soulforged7-Oct-09 15:47 
AnswerRe: Calling SSL WCF Service from Silverlight Pin
Nigel Ferrissey7-Oct-09 19:19
Nigel Ferrissey7-Oct-09 19:19 
GeneralRe: Calling SSL WCF Service from Silverlight Pin
Soulforged8-Oct-09 13:41
Soulforged8-Oct-09 13:41 
AnswerRe: Calling SSL WCF Service from Silverlight Pin
Mark Salsbery8-Oct-09 10:19
Mark Salsbery8-Oct-09 10:19 
QuestionSelector (ListBox, ComboBox) default selected item woes when bound to ObservableCollection Pin
Jeremy Likness7-Oct-09 10:32
professionalJeremy Likness7-Oct-09 10:32 
AnswerRe: Selector (ListBox, ComboBox) default selected item woes when bound to ObservableCollection Pin
Nigel Ferrissey8-Oct-09 12:08
Nigel Ferrissey8-Oct-09 12:08 
QuestionCan DataGrid Swap Row and Column? Pin
Frank W. Wu7-Oct-09 10:13
Frank W. Wu7-Oct-09 10:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.