Click here to Skip to main content
15,893,266 members
Home / Discussions / WPF
   

WPF

 
Questionwpf controls Pin
MemberDotNetting2-Apr-12 15:41
MemberDotNetting2-Apr-12 15:41 
QuestionRe: wpf controls Pin
Richard MacCutchan2-Apr-12 21:39
mveRichard MacCutchan2-Apr-12 21:39 
AnswerRe: wpf controls Pin
Abhinav S3-Apr-12 6:42
Abhinav S3-Apr-12 6:42 
QuestionGet a Model event in the ViewModel Pin
Mycroft Holmes29-Mar-12 23:38
professionalMycroft Holmes29-Mar-12 23:38 
AnswerRe: Get a Model event in the ViewModel Pin
Pete O'Hanlon29-Mar-12 23:53
mvePete O'Hanlon29-Mar-12 23:53 
GeneralRe: Get a Model event in the ViewModel Pin
Mycroft Holmes30-Mar-12 1:54
professionalMycroft Holmes30-Mar-12 1:54 
GeneralRe: Get a Model event in the ViewModel Pin
Pete O'Hanlon30-Mar-12 2:29
mvePete O'Hanlon30-Mar-12 2:29 
QuestionShowing image for datapoints in Scatter series in Silverlight Pin
Member 877261529-Mar-12 19:20
Member 877261529-Mar-12 19:20 
XML
Hi,

   I want to show an image for datapoints (same image for each data point) of the scatter series.the xaml looks like this :


     <UserControl.Resources>
        <ImageBrush x:Key="ImageBrushStyle" ImageSource="Images\customImage.png" />
        <Style x:Key="DataPointStyle1" TargetType="DVC:ScatterDataPoint">
            <Setter Property="Background" Value="{StaticResource ImageBrushStyle}"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="DVC:ScatterDataPoint">
                            <!--<Rectangle Fill="Yellow" Width="100" Height="100"  />-->
                        <Image Source="Images\customImage.png"></Image>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <DVC:Chart Canvas.Top="80" Canvas.Left="10" x:Name="mcChart_CustomSection"
           Width="800" Height="400"
           Background="Gray">
            <DVC:Chart.Series>
                <DVC:ScatterSeries Title=" SampleData"
            IndependentValueBinding="{Binding Path=Key}"
            DependentValueBinding="{Binding Path=Value}">
                </DVC:ScatterSeries>
            </DVC:Chart.Series>
        </DVC:Chart>
    </Grid>
</UserControl>


Then,
The code sets the style in this way :
   ((ScatterSeries)mcChart_CustomSection.Series[0]).ItemsSource =
                new KeyValuePair<int, int>[]{
                    new KeyValuePair<int, int>(1, 140),
                    new KeyValuePair<int, int>(2, 150)
                };

            var ss1 = (ScatterSeries)mcChart_CustomSection.Series[0];
            mcChart_CustomSection.Series.Remove(ss1);
            ss1.DataPointStyle = (Style)this.Resources["DataPointStyle1"];
            mcChart_CustomSection.Series.Add(ss1);


But, it does not work.(The points are not plotted).

Is it possible to show image there(Images\customImage.png)?


Thanks.

AnswerRe: Showing image for datapoints in Scatter series in Silverlight Pin
Member 877261529-Mar-12 20:00
Member 877261529-Mar-12 20:00 
Questionbinding with timer Pin
michaelgr129-Mar-12 5:46
michaelgr129-Mar-12 5:46 
AnswerRe: binding with timer Pin
Mycroft Holmes29-Mar-12 12:59
professionalMycroft Holmes29-Mar-12 12:59 
GeneralRe: binding with timer Pin
SledgeHammer0129-Mar-12 17:23
SledgeHammer0129-Mar-12 17:23 
GeneralRe: binding with timer Pin
Mycroft Holmes29-Mar-12 18:03
professionalMycroft Holmes29-Mar-12 18:03 
QuestionWPF Image Question Pin
Kevin Marois28-Mar-12 11:18
professionalKevin Marois28-Mar-12 11:18 
GeneralRe: WPF Image Question Pin
Kevin Marois28-Mar-12 13:00
professionalKevin Marois28-Mar-12 13:00 
GeneralRe: WPF Image Question Pin
SledgeHammer0128-Mar-12 13:25
SledgeHammer0128-Mar-12 13:25 
GeneralRe: WPF Image Question Pin
Kevin Marois28-Mar-12 13:38
professionalKevin Marois28-Mar-12 13:38 
GeneralRe: WPF Image Question Pin
Miroslaw Slanda4-Apr-12 1:46
Miroslaw Slanda4-Apr-12 1:46 
QuestionQuick Binding Question Pin
Kevin Marois28-Mar-12 8:16
professionalKevin Marois28-Mar-12 8:16 
AnswerRe: Quick Binding Question Pin
Pete O'Hanlon28-Mar-12 8:40
mvePete O'Hanlon28-Mar-12 8:40 
GeneralRe: Quick Binding Question Pin
Kevin Marois28-Mar-12 8:43
professionalKevin Marois28-Mar-12 8:43 
GeneralRe: Quick Binding Question Pin
SledgeHammer0128-Mar-12 9:46
SledgeHammer0128-Mar-12 9:46 
GeneralRe: Quick Binding Question Pin
Kevin Marois28-Mar-12 11:00
professionalKevin Marois28-Mar-12 11:00 
GeneralRe: Quick Binding Question Pin
SledgeHammer0128-Mar-12 11:08
SledgeHammer0128-Mar-12 11:08 
GeneralRe: Quick Binding Question Pin
Kevin Marois28-Mar-12 11:17
professionalKevin Marois28-Mar-12 11:17 

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.