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

  • SEARCH
  • Home
  • 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 8066317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:56:48+00:00 2026-06-05T11:56:48+00:00

I am new to MVVM and Silverlight I have managed to get an example

  • 0

I am new to MVVM and Silverlight

I have managed to get an example Silverlight application up and running

I return the contents of a table – tblClip into my model (Entity Framework) and an associated object Clip.

Now I have a field on my Clip called Size. This is an integer which I want to increase by 5x

What is the correct approach to do this and still keep to the pattern?

1) Add a new property such as ModifiedSize on the model and populate it (although not sure where) I assume I would need to decorate it as a DataMember to get it back to the client
2) In the view model, once I have obtained the data from the service agent, go through the clips increasing the size
3) Something else…?

I do not need to save the objects back to the database.

Paul

  • 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-06-05T11:56:51+00:00Added an answer on June 5, 2026 at 11:56 am

    UI specific properties belong on the ViewModel. For example, this is one way you could do it

    public class ClipViewModel
    {
        private int _size;
    
        public int Size
        {
            get { return _size; }
            set
            {
                _size = value;
                NotifyPropertyChanged("Size");
            }
        }
    
        public int ModifiedSize
        {
            get { return Size * 5; }
            set
            {
                Size = value / 5;
            }
        }
    }
    

    Binding to ModifiedSize in your XAML would then update Size as well as perform INotifyPropertyChanged notifications

    The other thing you can do is skip the ModifiedSize property and use a converter

    public class ModifiedSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, 
            object parameter, CultureInfo culture)
        {
            return (int)value * 5;
        }
    
        public object ConvertBack(object value, Type targetType, 
            object parameter, CultureInfo culture)
        {
            return (int)value / 5;
        }
    }
    

    and then bind to Size with the converter

    <Slider Value="{Binding Path=Size, Converter={StaticResource modifiedSizeConverter}}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have a silverlight MVVM application using MVVM light. When I open the
I am new to Silverlight and have been working with Simple MVVM to create
I have a silverlight mvvm application that loads main view with 2 user controls
we have developed an intranet application with Silverlight 4 using MVVM with PRISM. Up
I am using Silverlight 4 and MVVM pattern for my application. I have a
On my MVVM Silverlight application I need to call Domain service function to get
I have a Silverlight application architected using an MVVM approach. In my ViewModel it
I'm new to MVVM in silverlight. It's a bit confusing because although I get
I am new to Silverlight and CSLA and I need to get an example
I am new to WPF and MVVM, and I am working on an application

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.