Can the position and szing of a control element in a View be controlled from the ViewModel?

Is it possible to change the position of a control, say a label, as a response to some action/operation from the ViewModel?  Like if one response to something is true then place the label in the top left corner.  If false, place the label
in the lower right corner.  I realize you could have a label in each position and just set the visibility.  But can the position and sizing of said label be controlled from the View Model?  What would be a sample coding of this?  would
it be in the xaml or combination of a method in the ViewModel and the xaml? 
Rich P

First off Rich, say TextBlock to yourself ten times.
Use a TextBlock rather than a label.
There are a bunch of different ways to do this and the easiest is to have two controls whose text is bound to the one property.
Bind the Visibility of each to another 2 properties in the viewmodel.
Collapse one and Visible the other.
The reason for that is that it's easier.
Technically, you could put one textblock in a grid and use margin to control this.  You could animate x y co-ordinates and move the textblock mysteriously across the window if you put your mind to it.
Or you could put it in a row/column "cell" of a grid and change which cell it goes in - but that would involve some mechanism like messaging from the viewmodel to the view and is not really ideal if you can avoid it.
I'd have a pair of textblocks, here's one:
<TextBlock Name="TopLeftMsg"
Text="{Binding Msg}"
Visiblity="{Binding TopLeftVis}"
Both would bind to a public string property msg in the viewmodel.
They each get their own public visibility property  and that'd be switched between Visibility.Visible and Visibility.Collapsed.
Sizing of textblocks is best fitted to content because all you see is the text.
Textboxes are arguably different because you can see the things.
Hope that helps.
Recent Technet articles:
Property List Editing;  
Dynamic XAML

Similar Messages

  • I just started a free trial of the Adobe XI product that allows me to create an editable PDF. I'm done creating the form and ready to export it. When I click Export PDF from the File menu, it says Adobe encountered an unexpected error. What am I doing wro

    I just started a free trial of the Adobe XI product that allows me to create an editable PDF. I'm done creating the form and ready to export it. When I click Export PDF from the File menu, it says Adobe encountered an unexpected error. What am I doing wrong?

    Good to know  — there is no such application as "Adobe XI".
    "Adobe" is the name of the company.
    "XI" is indicative of the use of either Acrobat XI or Reader XI.
    Neither Acrobat XI Pro (for which Adobe provides a free, fully functional 30-day trial) nor Adobe Reader XI (the free to download and use PDF viewer that Adobe provides) have  an "Export PDF" entry under "File".
    "Export PDF" only is present in Adobe Reader XI over on the right on the "Tools" panel.
    The "Tools" panel provides a way for a user of Adobe Reader XI to connect to various By Subscription online services (gotta pay eh).
    Export PDF is one of these. A subscription lets you send a PDF file to the online internet service (aka "cloud" service). The service then exports to a supported file format (Word / Excel / ...) and the user selects / directs where the output file is to be saved on the user's local machine.
    Of course to use any of the online subscription services one must have an active (paid up in full) subscription to the service.
    So ---- As described the puzzle pieces don't fit eh.
    What specific Adobe (the company) applications are you using?
    Acrobat XI Pro? Adobe Reader XI? Both? 
    Be well....

  • I have a hotmail account sync. With my Mail on the Macbook and iPad, everytime I open my mac all emails are transfered from the iPad to the Macbook. Is there a way to keep a copy of the emails on the iPad? Or access them after transfered?

    I have a hotmail account sync. With my Mail on the Macbook and iPad, everytime I open my mac all emails are transfered from the iPad to the Macbook. Is there a way to keep a copy of the emails on the iPad? Or access them after transfered?

    AND yea i afraid to sync my iphone and lose everything ;( i had everything perfect sync ing perfect ical,contacts,mail,apps and now sence new library I dont wana lose everything.....my hole life runs on my fone i need help bad

  • I need to avoid my security question, because i dont remember the answers. and i need to authorize my account in order to purchase from the appstore

    I need to avoid my security questions, i dont know the answers, i dont remember it, and i have 30dlls on my apple id that i cant use cause of the security block. help me, ive been unable to purchase anything for about a 7 months now

    Go to https://iforgot.apple.com and follow the directions.

  • How can i change the position and size of the applet

    dear fellows,
    how can i change the position and size of the applet in which form is running over the web.
    thanx
    Mochoo

    Yes, you can add the following line to your formsweb.cfg section :
    HTMLbodyAttrs=onLoad='javascript:self.moveTo(100,100)'
    if you are in SEPERATEFRAME = FALSE
    Or Set_Window_Property( FORMS_MDI_WINDOW, POSITION, X, Y ) ;
    if you are in SEPERATEFRAME = TRUE

  • Update table HRP1001. Change the Position and the Org Unit.

    Hi,
    I am new to SAP HR and have been given a work in this area. The requirement is to update the relationship table HRP1001 replacing the old Manager' Position and the Org Unit with the New Manager's Position and the Org. Unit.
    I have some how found out the way to get the Postion and the Org unit of the old manager. Now I am replacing the same with the new details using the Update HRP1001 Command but this is the old and not recommended method acheiving this task.
    Can anyone please suggest me any Function Module OR the BAPI to update the HRP 1001 table with the New MAnager;s Position and the Org Unit.
    Thanks...!!!
    Regards,
    Deepak.

    Hi Kalpesh,
    I am using the FM: 'BAPI_HRMASTER_SAVE_REPL_MULT'but still not updating. I am trying to change the Position and the Org unit but not successful yet.
    I first used the Operator 'I' withi the table BAPIHROBJ-OPERATOR, it failed then I tried 'U' for update it still failed. Can you please let me know how many such operations possible with their charecter values apart from I & U. the domain value set does not exist as it is char1.
    Now I came to know that I have to terminate the old relationship by changing the ENDDA and create a new one with the new BEGDA as tomorrow's date.
    Can you please suggest something.
    Regards,
    Deepak.

  • I bought the Keynote app for my MacBook, but when I open the application and try to install it, I get an error message saying that the application will not work with my MacBook. What gives? And, can I please request a refund? ($19.99 = a week's groceries)

    I bought the Keynote app for my MacBook, but when I open the application and try to install it, I get an error message saying that the application will not work with my MacBook. What gives? And, can I please request a refund? ($19.99 = a week's groceries).
    Thank you for your help! - I did try looking for all available specs about Keynote on the Apple iTunes website, and found nothing that could help me. HELP!

    1
    Close all iWork applications
    2
    Uninstall Keynote; this must be done with an application remover tool to delete the installation properly. Appcleaner is known to work correctly for this purpose, it is free and can be downloaded from here: Appcleaner Download
    3
    empty the trash
    4
    shutdown the Mac and restart. After the start up chime, hold down the shift key until the apple logo appears
    let the Mac complete the start up procedure completely, it will take longer than usual as the hard drive is being repaired
    5
    Reinstall Keynote by logging into the Mac App Store using download / install

  • HT204266 I live in China, have Dutch nationality, and no US address or Credit Card; how can I have access to products from the US iTunes store, in particular music, when such items are not available from the China iTunes store? In general, what are the di

    I live in China, have Dutch nationality, and no US address or Credit Card; how can I have access to products from the US iTunes store, in particular music, when such items are not available from the China iTunes store? In general, what are the differences between countries' iTunes offerings? Does one really need an address and a credit card for any country to be able to access that countries iTunes store? Why these restrictions?

    You cannot.
    You cannot use another countrys itunes store.
    You must be physically locates inside the borders of a country to use that countrys itunes store and a credit card issued in that country with a valid billing address in that country.
    The owners of the distribution rights of movies/music/etc differ by country.  These distributors decide who can sell their content in that country.
    Buy from another source if your countrys itunes store does not carry somehting that you want.

  • After I updated user for i phone 4 s iCloud password is no way I can not phone and e-mail address has been blocked. I did not bring the solution to Turkey APPLE chief BILKOM is forgotten the password and e-mail address in the e-mail address asking for hel

    After I updated user for i phone 4 s iCloud password is no way I can not phone and e-mail address has been blocked. I did not bring the solution to Turkey APPLE chief BILKOM is forgotten the password and e-mail address in the e-mail address asking for help from you I will make the iphone does not open e-mail address associated with it @hotmail.com mail to this address icloud iphone phone's password is forgotten, I want to thank you in advance for your help tell a method of opening up again.
    <Email Edited by Host>

    Welcome to the Apple Community.
    I have asked for your email address to be edited out. Posting your address in an open thread is a sure way to be bombarded by unwanted email, remember it will be here long after you have resolved your problem, for automated detection software to find.
    If you want people to contact you, enable others to see your email address in your profile.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID, verify the changes, enter the password as requested on your device and then turn off "find my phone".
    You should then change your Apple ID back to its current state, verify it once again, delete the iCloud account from your device and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    Apple Topluluk hoş geldiniz.
    Ben düzenlenebilir için e-posta adresi için istedi. Açık bir konu adres gönderme istenmeyen e-posta ile bombardıman bir emin yoludur, bulmak için otomatik algılama yazılımı için, size sorunu giderilmiştir sonra burada uzun olacak unutmayın.
    Eğer insanlar sizinle iletişim istiyorsanız, başkalarının profilinizde e-posta adresinizi görmelerini sağlar.
    Bu özellik onları çalıntı olduğunu bu işe yaramaz çalıntı telefonları için getirilmiştir.
    Ancak aynı zamanda kullanıcı Apple ile Apple ID ayrıntıları değişti ve iCloud hesabı için aynı değişiklik yapmamış ortaya çıkar / iOS 7 yükseltmeden önce cihaz üzerinde My Phone bul olabilir.
    Tek çözüm My Apple ID de Apple ile önceki durumuna geri Apple ID değiştirmek için, değişiklikleri doğrulamak cihazınızda talep olarak, şifreyi girin ve sonra kapatın "benim telefon bulmak".
    Daha sonra tekrar bugünkü durumuna Apple ID değiştirmek gerekir, bir kez daha doğrulamak cihazınızdan iCloud hesabı silmek ve daha sonra mevcut Apple kimliği kullanarak oturum açın. Son olarak, geri bir kez daha üzerinde "benim telefon bulmak" açın.

  • I have lost my "Basic" panel in the Develop module and can't figure out how to get it back. My right panel goes from the Histogram straight to the Tone Curve panel.  My Basic panel should be below the Histogram.  Any ideas how to get it back.  I have even

    I have lost my "Basic" panel in the Develop module and can't figure out how to get it back. My right panel goes from the Histogram straight to the Tone Curve panel.  My Basic panel should be below the Histogram.  Any ideas how to get it back.  I have even uninstalled my lightroom and reinstalled it with same issue.  Help!!!

    Right click on or near one of the other headers and a pop-up will appear and you will be able to select the Basic Panel for viewing.

  • Hay. i change the screen LCD in IPAD 2 3G but i don't know what happen. She was working and every thing it's ok. One time i turn off the ipad and turn on more time, i don't see good in LCD the  brightness is to low and i can see any thing

    Hay. i change the screen LCD in IPAD 2 3G but i don't know what happen. She was working and every thing it's ok. One time i turn off the ipad and turn on more time, i don't see good in LCD the  brightness is to low and i can see any thing!! and i want to know why is happen

    Assuming you mean that you performed the repair yourself, it would seem that you either obtained a defective screen or you did some sort of damage when you replaced the screen. You can try asking for assistance on ifixit.com, a site dedicate to those attempting their own repairs, or you can take the iPad to a shop and pay them to try to correct the problem for you. Apple will no longer touch your iPad now that you've attempted your own repairs.
    Regards.

  • HT3775 I just upgraded my ipad to 6.0.  I can no longer expand my audio files so that I can move forwards and backwards.  I used to get a diagonal arrow to enlarge the screen and then have a bar that I can move to navigate. Can you help?

    I just upgraded my ipad to 6.0.  I can no longer expand my audio files so that I can move forwards and backwards.  I used to get a diagonal arrow to enlarge the screen and then have a bar that I can move to navigate. Can you help?

    Hi James,
    I am listening to embedded training files on the Quick Time player (I think). They cannot be copied to protect the information.  You only have the option of listening.   I used to be able to click on the Q in the audio strip and it would provide a diagonal arrow and this would allow me to expand the bar to a full screen. I then had the bar which would allow me to navigate in case I wanted to listen again or in case I wanted to move forward.  After my upgrade, I can no longer expand the strip to a full screen with the adjuster.  Now I have not chance to take a break in listening to these audios and most of them are at least an hour long.  Thanks for your help.

  • How come there are no hidden objects games in the South African App Store and y does safari not allow you to get it downloaded from the net. There are only games for kids in the App Store. Can anyone help

    How come there are no hidden objects games in the South African App Store and y does safari not allow you to get it downloaded from the net. There are only games for kids in the App Store. Can anyone help.  Is the South African apple ipad only for children

    Nobody here is responsible for what is or is not available in any country. I believe it is a software licensing thing.

  • I updated my iMac to Mountain Lion and when I want to fit my screen view... in the last version I had to examples where I could choose wide after format but I miss that function now in Mountain Lion. Can anyone please help me???

    I updated my iMac to Mountain Lion and when I want to fit my screen view... in the last version I had to examples where I could choose wide after format but I miss that function now in Mountain Lion. Can anyone please help me???

    I'm sorry for my bad english, my problem is that I want the program I open in a new window to be avilable in full screen mode. Before I uppdated my os to Montaine Lion I could choose wide under screen in settings. I'll take an ex for you. When I play poker online I want to see the tabel in full screen but I don't manage to fix that. Do you Sir have any idea???

  • How to make Nokia Suite remember the position and ...

    how to make Nokia Suite remember the position and the size i set it?
    because everytime i start it, it defaults in the middle of the screen and in the smallest possible size.
    Nokia Suite 3.3.86
    Windows Vista
    Greece Nokia X6 RM-559 v40.0.002

    Again, are you talking about genuine Nokia firmware, not any of some 3rd-party customised versions?
    For officially released firmware, you may force Nokia Suite to reinstall even if your firmware is already up to date. This feature might be missed in its GUI as its link is "hidden" in the prompt message, not on a button or highlighted with underscore. Try Nokia Suite, once the phone is connected, click the icon of Software Update on the top, then click the word "reinstall" in the prompted message.
    bbao
    * If this post helped you, please click the white Kudo star.
    * If this post has solved your issue, please click Accept as Solution.

Maybe you are looking for

  • How to turn off Ad-Hoc Network

    Hi, I was running my wifi this afternoon and while exploring wicd I've accidentally added an Ad-Hoc Network.  After the incident I can no longer see wireless networks both with archassistant and wicd....:( Are there any ways to reset to default confi

  • SAPscript to PDF in SAP 4.0B - Logo Not appearing correctly

    Hi Gurus, I have an issue where I am converting a Sapscript to a PDF using CONVERT_OTF Function Module. The PDF is being generated correctly but the logos are appearing in other places or not appearing at all. The SAP Version is SAP 4.0B (Really old

  • 13014 Help

    When i try and open my itunes library from my EHD, a 13014 code keeps popping up, and itunes wont open. What can be the problem?

  • Installed SQL Server with license key provided by Microsoft still it showing expiry date after 6 months

    I Installed Sql Server 2008 in my Windows 2008 Server everthing good but after installed when i check expiry date of SQL SERVER using query its showing after 180 Days my Sql will be expiry. Did i done any mistake while installed or do i want to any a

  • Junk Charecters in alert mails

    Hi, We are facing a weird problem. We have created a alert category, and have defined long text as below : Dear Reader, Please find the below details of the error occured in SAP PI system: SENDER SYSTEM: &SENDER& RECEIVER: &RECEIVER& MESSAGEID: &MESS