Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6191597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:47:39+00:00 2026-05-24T02:47:39+00:00

I am developing a Silverlight 4 RIA (Entity framework) application and I am having

  • 0

I am developing a Silverlight 4 RIA (Entity framework) application and I am having issues using a MVVMLight RelayCommand. I have used them before without problem but there seems to be an issue after I have implemented the ViewModelLocator pattern.

The bindings on the button control generates no issues and the application runs but the button click does not fire the RelayCommand.

When I try to bind the RelayCommand in Blend it can not see the SelectionCommand property but it can the others such as IsBusy.

Any idea what I am doing wrong?

    <ListBox x:Name="ListBox" ItemsSource="{Binding Draws}" Background="Transparent">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Background="Transparent" HorizontalAlignment="Stretch" Orientation="Vertical" >
                    <telerik:RadButton Background="Transparent" Command="{Binding Path=SelectionCommand}" CommandParameter="{Binding Path=ID}"  >
                        <Image Source="{Binding Path=DrawImage, Converter={StaticResource imgConverter}, TargetNullValue=/NSPCCLotteryDraw;component/Assets/Images/JCBLogo.PNG}" Stretch="UniformToFill"/>
                    </telerik:RadButton>                      
                    <TextBlock Text="{Binding Path=DrawName}" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Times New Roman" FontSize="20" Margin="5,0,0,0" TextWrapping="Wrap" />
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <telerik:RadWrapPanel VerticalAlignment="Center" />
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    </ListBox>

Imports GalaSoft.MvvmLight
Imports GalaSoft.MvvmLight.Command

Public Class DrawSelectorViewModel
    Inherits ViewModelBase

    Private _dataService As ILotteryDraw

    Private _draws As IEnumerable(Of Draw)

    Private _isBusy As Boolean

    Public Property SelectionCommand As RelayCommand(Of Int32)

    Public Property Draws As IEnumerable(Of Draw)
        Get
            Return _draws
        End Get
        Set(value As IEnumerable(Of Draw))
            _draws = value
            IsBusy = False
            RaisePropertyChanged("Draws")
        End Set
    End Property

    Public Property IsBusy As Boolean
        Get
            Return _isBusy
        End Get
        Set(value As Boolean)
            _isBusy = value
            RaisePropertyChanged("IsBusy")
        End Set
    End Property

    Public Sub New(dataService As ILotteryDraw)
        _dataService = dataService
        SetupCommands()
        LoadAvailableDraws()
    End Sub

    Private Sub SetupCommands()
        SelectionCommand = New RelayCommand(Of Int32)(AddressOf ShowLotteryDraw)
    End Sub

    Private Sub LoadAvailableDraws()
        IsBusy = True
        _dataService.GetActiveDraws(Sub(e) Draws = e)
    End Sub

    Private Shared Sub ShowLotteryDraw(drawID As Int32)
        Stop
    End Sub

End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:47:39+00:00Added an answer on May 24, 2026 at 2:47 am

    I believe it will try and fire SelectionCommand on an instance of Draw. You need to use something like the DataContextProxy or a relative source binding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been experimenting recently with Silverlight, RIA Services, and Entity Framework using .NET
I'm developing a Silverlight application with Entity Framework and RIA Services. When I create
I am developing a silverlight 3 application using WCF RIA services. I am using
I am developing a RIA using Silverlight its completely Database Driven Application but I
I'm developing a Silverlight Business Application, using a RIA service, which is returning POCO
I'm developing an application using WCF Ria services and Silverlight. Performance and scalability is
I am developing a RIA application in silverlight and my requirement is that I
I am developing a Silverlight app using VS2008 Express. I have just implemented a
We are developing an Silverlight with Wcf business application. We are using Wcf DataContract
I'm developing a small web application using Microsoft Silverlight 3. I'm using Microsoft Expressin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.