Grid spacing in Windows Phone Runtime XAML

Hello
I've got a simple problem with XAML UI in Windows Phone 8.1 Runtime. I always want my button control to appear on the very bottom of the page (just above an App Bar), horizontally stretched.
On Windows Phone 8.0/8.1 Silverlight such a simple requirement was done just by this code:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.1*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" >
--some content here, which has to be on the rest of the page--
</StackPanel>
<Button x:Name="BtnOnTheBottom" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
</Grid>
To make this working on this Windows Runtime thing, I have to explicitly set Grid's Height to any value. Then, the bottom 10% of the explicitly passed value is taken by this button. But users might have different screen sizes and on bigger screen this explicitly
assigned value may lead the button to appear in the middle of the screen, which I don't want.
The second thing I don't want to do is to rely on the page SizeChanged event and dynamically assign the pixel values. I want everything be done in the XAML way.
Is it possible on this Windows Runtime thing to achieve such an extremely difficult requirement to be done only on XAML side :P?
Many thanks in advance

StackPanel always squishes to the smallest amount of room possible, which is why you're having problems. The stackpanel doesn't take up very much room, and the Grid doesn't fill up the entire amount of space.  Try this:
<Grid>
<StackPanel >
</StackPanel>
<Button HorizontalAlignment="Stretch" Content="Button" VerticalAlignment="Bottom"/>
</Grid>
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.

Similar Messages

  • [WPSL][C++]linking to C++ library in a Windows Phone Runtime Component

    Hi,
    I want to do what you said:
    "Compile the c++ source code as .Lib/.h files
    Create a Window Phone Runtime Component Wrapper"
    Did you have a link that have a explicite exemple for the "c++ source code as .lib". I didn't find relative post with example...
    Thanks for help

    Hi Math.DS,
    >>Did you have a link that have a explicite exemple for the "c++ source code as .lib
    You could create static library for window phone 8/8.1 silverlight app, see
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh771041.aspx
    >>Create a Window Phone Runtime Component Wrapper"
    You can wrap your C++ libraries with a Windows Runtime Component and call those APIs from your managed project, see this article:
    http://blogs.msdn.com/b/windowsappdev/archive/2012/08/06/building-your-own-windows-runtime-components-to-deliver-great-metro-style-apps.aspx
    This official sample is also helpful:
    https://code.msdn.microsoft.com/windowsapps/Windows-Runtime-Component-fb644b34
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Who know to develop httm agility pack on windows phone "runtime". I need to help.

    I don't know why it is null.
    string url = "http://dictionary.cambridge.org/dictionary/british/appeal";
    HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
    doc.LoadHtml(url);
    var infor = doc.DocumentNode.Descendants().Where(n => n.Name == "h2" && n.Attributes["class"].Value == "di-title").FirstOrDefault();
    Assets.ClassHttpAgilityPack http = new Assets.ClassHttpAgilityPack();
    txtword.Text = infor.FirstChild.InnerText;
    Infor =null;

    Hi Greg,
    The HtmlAgilityPack.HtmlDocument.LoadHtml is just for loading HTML text. You need to get HTML source and then use this method to import to HtmlDocument object.
    Use the HttpClient to instead. See more from
    http://stackoverflow.com/questions/26184968/webclient-doesnt-exist-on-windows-phone-8-1-downloading-html-of-site.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • How to print a grid from windows phone 8.1 application

    Hello ,
    I want to print a grid from a windows phone application.
    For tablet I can print using this namespace:
    using Windows.Graphics.Printing;
    using Windows.UI.Xaml.Printing;
    But they are only for Tablet.
    Please suggest a solution of printing from windows 8.1 phone application.
    Thanks

    Hi waqar.haider.confiz,
    >>How to print a grid from windows phone 8.1 application                                 
    As far as I known, in Windows Phone 8.1 app it does not have such API for us to print a grid. I will recommand you submit this feature request on this
    UserVoice forum.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I am converting existing wpf application to Windows phone 8 app using visual studio 2013

    i want to replace the  xmltextreader for windows phone 8 project ????
    as we dont have  xmltextreader.whitespacehandling...... how to replace this for windows phone project.....
    and i am getting some more error like 'system.net.sockets.socket' doesnot contain a defination for 'beginconnect' and no extension method 'beginconnect' accepting a first argument........

    Hi sagaradi,
    >> So now i want to target that application  to windows 8.1 store and Windows phone 8.1
    For the exception about "System.net.sockets.socket doesnot contain a defination for 'BeginAccept' and no extension mehod 'BeginAccept' accepting a first argument of type 'system.sockets'cuold not be found",
    it is because that System.Net.Sockets is not available in Windows Phone Runtime app, we have to use the
    Windows.Networking.Sockets for instead, for more information, please try to refer to:
    http://stackoverflow.com/questions/23477961/cannot-find-system-net-sockets-assembly-for-wp-8-1 .
    For others exceptions, since I do not have your code, it will be hard to tell. But although WPF/Windows Phone/Windows Store are all XAML-based platforms, they still have a lot of difference among them. Some API which are available in the WPF
    may be not available in the Windows Store and Windows Phone. So please pay attention on it, for more information, please try to refer to the following article:
    #Move form WPF and Microsoft Silverlight to WinRT:
    https://msdn.microsoft.com/en-us/library/windows/apps/br229571.aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Issue with Sqlite for Windows Phone 8.1!

    Hello all,
    I was working on a Windows phone 8.1 silverlight project, which I thought of discontinuing, and transform that same project as a Windows Phone 8.1 runtime project. After reading through a lot of articles on the web, which says that Windows Phone runtime API
    would be the one that will be used to develop applications for a variety of devices, so I thought of thinking on the long run and decided to stick with the Windows Phone runtime 8.1. 
    I am not sure whether I made a strange decision, since I moved to Windows phone runtime I haven't made a single step ahead in my project. What I get is all exceptions. I am trying hard to make SQLite work with my project, I am not sure what I am missing, I
    went through all the tutorials on the web and I feel that everything is right in my code.
    Here is the link to the project, could somebody have a look into it and advise me on what I am doing wrong.
    Project Link
    Thanks all.
    Thanks, Sumesh

    Hello Sumesh,
    From your description, it seems that your issue is related with windows phone development, and after checking the project with your provided download link, it seems to not be related with LINQ to SQL item, if you are actually want to ask a windows phone
    issue, you could ask it
    here. And I suggest that you could share these exceptions message you encounter with us on this forum.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Attention All Windows Phone Gurus! Time to SPRING Into Action!

    April fools out of the way, now let's find an April genius!
    The name "April" is derived from the Latin verb "aperire", meaning "to open", as it is the season when trees, flowers AND MINDS start to open! And.. I can't wait to OPEN and read this month's community contributions!
    (groan, tenuous link!)
    Things are indeed heating up around TechNet. The Wiki has become a shining example of what the community has to offer, and talent is SPRINGING FORTH from all corners of our garden of knowledge. 
    If you can find the time to enrich us with your latest revelations, or some fascinating facts, then not only will you build up a profile and name for yourself within the gaze of Microsoft's very own glitterati, but you will be adding pages to the most respected
    source for Microsoft knowledge base articles. This could not only boost your career, but would benefit generations to come!
    So don't be an April fool. Please realise the potential of this platform, realise where we are going, and join us in growing this community, learning more about you, and opening the minds of others!
    All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something
    you had to solve for your own day's work today.
    Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!
    This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!
    HOW TO WIN
    1) Please copy over your Microsoft technical solutions and revelations to
    TechNet Wiki.
    2) Add a link to it on
    THIS WIKI COMPETITION PAGE (so we know you've contributed)
    3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.
    If you win, we will sing your praises in blogs and forums, similar to the
    weekly contributor awards. Once "on our radar" and making your mark, you will probably be
    interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!
    Winning this award in your favoured technology will help us learn the active members in each community.
    Feel free to ask any questions below.
    More about TechNet Guru Awards
    Thanks in advance!
    Pete Laker
    #PEJL
    Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to
    TechNet Wiki, for future generations to benefit from! You'll never get archived again, and
    you could win weekly awards!
    Have you got what it takes o become this month's
    TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

    4 articles so far:
    VariableSizedWrapGrid by
    Tom Mohan
    Implementing media stream sources in Windows Phone Runtime for background audio tasks by
    mcosmin
    Windows Phone 8.1: Sqlite (part two) by
    Carmelo La Monica
    Making a Windows Phone App to read TechNet profile through JSON by
    Emiliano Musso
    And 2 more days to go!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How do I distribute a dll with UserControl made for Windows Phone 8.1 Xaml WinRT to other developers

    I have created a dll for Windows Phone 8.1 Xaml WinRT.  It has two UserControls and two classes with APIs for developers to use.  In the Silverlight environment, I would just send the DLL from the BIN directory to the other developers who would
    reference it and be able to consume the UserControls.
    With WP 8.1 Xaml there are several files in the BIN directory besides the DLL; there is also the following:
    A .pdb file
    A .xbf for each UserControl
    A .pri file
    A .xr.xml file
    When I send it to the other developers and they have all of the files from the BIN directory, they reference the .DLL but get the following when they try to use one of the UserControls at design time:
    TargetInvocationException: Exception has been thrown by the target of an invocation.
    TypeLoadException: Could not find Windows Runtime type 'Windows.UI.Xaml.TickBar'.How do I need to package this for the other developers to be able to consume properly.  I looked at Visual Studio
    Extensions that that seems like a lot of work to just send someone a DLL.
    Dick

    Hello Dick , 
    I have a problem similar to your problem, currently I am making a one dll file that contained  one class file and one User control. after build project
     I could see files like  this a photo.
    Acutually I am trying to  make a extension sdk, but I don't know correctly how to place files to dirctroy.
    As mentioned by you I tried to follow.
    LIBRARYNAME.dll
    LIBRARYNAME.pri
    LIBRARYNAME(folder)
    ---UserControl.xbf
    ---UserControl.xaml
    ---UserControl.xr.xml
    But I can not use the xaml( usercontrol.xaml ) on when installed in other apps.
    This is my vsix folder sturucutre ,Let me know if you ever know about that
    best regard 
    Derrick

  • How to use the code written in App.Xaml.cs in Windows Phone 8 in Windows Phone 8.1 Universal Apps

    i have a App.xaml.cs file in Windows Phone 8.0 , amd i want to use the code in that file to make work with App.xaml.cs file in Windows Phone 8.1 Universal Apps
    My Windows Phone 8 App.xaml.cs file is like as below
    namespace OnlineVideos
    public partial class App : Application
    #region Initialization
    public static dynamic group = default(dynamic);
    public static dynamic grouptelugu = default(dynamic);
    public static ShowList webinfo = default(ShowList);
    public static WebInformation webinfotable = new WebInformation();
    AppInitialize objCustomSetting;
    IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
    DispatcherTimer timer;
    IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
    public static bool AdStatus = false;
    public App()
    UnhandledException += Application_UnhandledException;
    if (System.Diagnostics.Debugger.IsAttached)
    Application.Current.Host.Settings.EnableFrameRateCounter = true;
    //RootFrame.UriMapper = Resources["UriMapper"] as UriMapper;
    AppSettings.NavigationID = false;
    objCustomSetting = new AppInitialize();
    timer = new DispatcherTimer();
    Constants.DownloadTimer = timer;
    InitializeComponent();
    InitializePhoneApplication();
    #endregion
    #region "Private Methods"
    void StartDownloadingShows()
    timer.Interval = TimeSpan.FromSeconds(10);
    timer.Tick += new EventHandler(timer_Tick);
    timer.Start();
    void timer_Tick(object sender, EventArgs e)
    try
    BackgroundWorker worker = new BackgroundWorker();
    worker.DoWork += new DoWorkEventHandler(StartBackgroundDownload);
    worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
    worker.RunWorkerAsync();
    catch (Exception)
    void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    if (AppSettings.StopTimer == "True")
    timer.Stop();
    AppSettings.StopTimer = "False";
    async void StartBackgroundDownload(object sender, DoWorkEventArgs e)
    switch (AppSettings.BackgroundAgentStatus)
    case SyncAgentStatus.DownloadFavourites:
    if (AppSettings.DownloadFavCompleted == false && AppSettings.SkyDriveLogin == true)
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    ReStoreFavourites reStoreFav = new ReStoreFavourites();
    await reStoreFav.RestorefavFolder(ResourceHelper.ProjectName);
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadFavourites;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadFavourites;
    break;
    case SyncAgentStatus.UploadFavourites:
    bool result = Task.Run(async () => await Storage.FavouriteFileExists("Favourites.xml")).Result;
    if (AppSettings.SkyDriveLogin == true && result)
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    UploadFavourites upLoad = new UploadFavourites();
    await upLoad.CreateFolderForFav(ResourceHelper.ProjectName);
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadParentalControlPreferences;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadParentalControlPreferences;
    break;
    case SyncAgentStatus.RestoreStory:
    if (AppSettings.DownloadStoryCompleted == false && AppSettings.SkyDriveLogin == true && (ResourceHelper.ProjectName == "Story Time" || ResourceHelper.ProjectName == "Vedic Library"))
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    RestoreStory restore = new RestoreStory();
    //if (ResourceHelper.ProjectName == "Story Time")
    await restore.RestoreFolder("StoryRecordings");
    //else
    // await restore.RestoreFolder("VedicRecordings");
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadStory;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.UploadStory;
    break;
    case SyncAgentStatus.UploadStory:
    if (AppSettings.SkyDriveLogin == true && (ResourceHelper.ProjectName == "Story Time" || ResourceHelper.ProjectName == "Vedic Library"))
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    timer.Stop();
    UploadStory st = new UploadStory();
    //if (ResourceHelper.ProjectName == "Story Time")
    await st.CreateFolder("StoryRecordings");
    //else
    // await st.CreateFolder("VedicRecordings");
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadFavourites;
    timer.Start();
    else
    AppSettings.BackgroundAgentStatus = SyncAgentStatus.DownloadFavourites;
    break;
    default:
    ShowDownloader.StartBackgroundDownload(timer);
    break;
    #endregion
    #region "Application Events"
    private void pop_Opened_1(object sender, EventArgs e)
    DispatcherTimer timer1 = new DispatcherTimer();
    timer1.Interval = TimeSpan.FromSeconds(5);
    timer1.Tick += timer1_Tick;
    timer1.Start();
    void timer1_Tick(object sender, EventArgs e)
    (sender as DispatcherTimer).Stop();
    Border frameBorder = (Border)VisualTreeHelper.GetChild(Application.Current.RootVisual, 0);
    Popup Adc = frameBorder.FindName("pop") as Popup;
    Adc.IsOpen = false;
    private void Application_Launching(object sender, LaunchingEventArgs e)
    SQLite.SQLiteAsyncConnection conn = new SQLite.SQLiteAsyncConnection(Constants.DataBaseConnectionstringForSqlite);
    Constants.connection = conn;
    AppSettings.AppStatus = ApplicationStatus.Launching;
    AppSettings.StopTimer = "False";
    objCustomSetting.CheckElementSection();
    SyncButton.Login();
    if (AppSettings.IsNewVersion == true)
    AppSettings.RatingUserName = AppResources.RatingUserName;
    AppSettings.RatingPassword = AppResources.RatingPassword;
    AppSettings.ShowsRatingBlogUrl = AppResources.ShowsRatingBlogUrl;
    if (ResourceHelper.AppName == Apps.Online_Education.ToString() || ResourceHelper.AppName == Apps.DrivingTest.ToString())
    AppSettings.QuizRatingBlogUrl = AppResources.QuizRatingBlogUrl;
    AppSettings.LinksRatingBlogUrl = AppResources.LinksRatingBlogUrl;
    AppSettings.ShowsRatingBlogName = AppResources.ShowsRatingBlogName;
    AppSettings.LinksRatingBlogName = AppResources.LinksRatingBlogName;
    if (ResourceHelper.AppName == Apps.Online_Education.ToString() || ResourceHelper.AppName == Apps.DrivingTest.ToString())
    AppSettings.QuizLinksRatingBlogName = AppResources.QuizLinksRatingBlogName;
    Constants.UIThread = true;
    group=OnlineShow.GetTopRatedShows().Items;
    grouptelugu = OnlineShow.GetRecentlyAddedShows().Items;
    Constants.UIThread = false;
    StartDownloadingShows();
    private void Application_Activated(object sender, ActivatedEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Active;
    if (ResourceHelper.AppName == Apps.Kids_TV_Pro.ToString())
    AppSettings.ShowAdControl = false;
    private void Application_Deactivated(object sender, DeactivatedEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Deactive;
    AppState.RingtoneStatus = "TombStoned";
    private void Application_Closing(object sender, ClosingEventArgs e)
    AppSettings.AppStatus = ApplicationStatus.Closing;
    private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
    FlurryWP8SDK.Api.LogError("Error at Application_UnhandledException in App.xaml.cs", e.ExceptionObject.InnerException);
    if (System.Diagnostics.Debugger.IsAttached)
    System.Diagnostics.Debugger.Break();
    else
    Exceptions.SaveOrSendExceptions("Exception in Application_UnhandledException Method In App.xaml.cs file.", e.ExceptionObject);
    e.Handled = true;
    return;
    #endregion
    #region Phone application initialization
    public PhoneApplicationFrame RootFrame { get; private set; }
    // Avoid double-initialization
    private bool phoneApplicationInitialized = false;
    // Do not add any additional code to this method
    private void InitializePhoneApplication()
    if (phoneApplicationInitialized)
    return;
    // Create the frame but don't set it as RootVisual yet; this allows the splash
    // screen to remain active until the application is ready to render.
    RootFrame = new PhoneApplicationFrame();
    if (App.Current.Resources["AdVisible"] as string == "True")
    RootFrame.Style = App.Current.Resources["RootFrameStyle"] as Style;
    RootFrame.ApplyTemplate();
    RootFrame.Navigated += CompleteInitializePhoneApplication;
    // Handle navigation failures
    RootFrame.NavigationFailed += RootFrame_NavigationFailed;
    // Ensure we don't initialize again
    phoneApplicationInitialized = true;
    //NonLinearNavigationService.Instance.Initialize(RootFrame);
    private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
    if (System.Diagnostics.Debugger.IsAttached)
    System.Diagnostics.Debugger.Break();
    else
    Exceptions.SaveOrSendExceptions("Exception in RootFrame_NavigationFailed Method In App.xaml.cs file.", e.Exception);
    e.Handled = true;
    return;
    // Do not add any additional code to this method
    private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
    // Set the root visual to allow the application to render
    if (RootVisual != RootFrame)
    RootVisual = RootFrame;
    // Remove this handler since it is no longer needed
    RootFrame.Navigated -= CompleteInitializePhoneApplication;
    #endregion
    Mohan Rajesh Komatlapalli

    Basically you are asking as how to port silverlight to Xaml (RT). Go one by one converting each API from silverlight to XAML, like IsolatedStorage isn't there in RT, so look for its alternative etc.
    See here the namespace/class mappings : Windows Phone Silverlight to Windows Runtime namespace and class mappings
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How to disable webview cache for Windows Phone 8.1 Runtime universal app?

    Is it possible to disable cache for the Webview control for a Windows Phone 8.1 runtime universal app? My App seems to be remembering the information it received the first time. My app logs me into a service and when I go back to rerun app in the emulator
    (without completing shutting down the emulator) it logs me in automatically rather than giving me the prompt. This behavior is in the NavigationCompleted handler if that helps explain a bit more on where I am hitting this issue.
    If I were to shut off the emulator completely and then restart it then I am prompted for the login name and password again. I have gotten over this cache issue, when I was using the HttpClient in other part of my app, by sending the no-cache in the header
    as:
    client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
    Can I do something similar for the webview control?
    thanks
    mujno

    Hi mujno,
    As I know currently there is no programmatically way to clean cache for WebView, see Matt's blog:How to clear the WebView cache
    However if you are developing an enterprise app, you should be able to invoke some scripts to clean for you, see this for more information:Brokered
    Windows Runtime Components for side-loaded Windows Store apps
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • WCF Add Service Reference Not Supported for Windows Phone 8.1 XAML Applications

    Windows Phone 8.1 XAML applications does not support the System.ServiceModel namespace, and therefore you are not able to right click references in the project and choose Add Service Reference.   The recommended solution is to add a REST endpoint
    to your WCF endpoint, and access the WCF application through the REST endpoint using HttpClient.
    Bret Bentzinger (MSFT) @awehellyeah

    My opinion on this subject is that someone in management needs to get rid of the "Yes Man" and hire someone with a backbone.
    A project (such as this one) suffered big time because of your excuse of meeting a deadline. Did nobody do feasibility studies to determine the effects of removing the ServiceModel namespace and how it would break migration? It wasn't removed from the other
    project types, so it wasn't a point that it wouldn't fit on the device, so it came down to testing and someone dropped the ball. This is poor management, and deadlines should be extended for critical points within a project. Think about the public relations
    that has already been set backwards by this move. I believe that it meets the critical criteria only because you are talking about targeting the mobile devices which consume external data sources as a key component. Lacking the ServiceModel namespace was a
    monumental error on the teams part.
    This is a perfect case of "we can ship the car", but the wheels will have to wait...they can "Flintstone it" until we get the wheels ready.
    Thomas Mullen
    Thomas Mullen

  • Listview carsh issue in windows phone 8.1 runtime app

    Hi,
    I have the list view which i am binding with the list of items and the list contains 104 items and it can be more.
    When i scroll down the items the listview crashes with following exception:-
    The operation attempted to access data outside the valid range (Exception from HRESULT: 0x8000000B)
    System.ArgumentOutOfRangeException: This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1).
    Parameter name: index
       at System.Runtime.InteropServices.WindowsRuntime.ListToBindableVectorAdapter.EnsureIndexInt32(UInt32 index, Int32 listCapacity)
       at System.Runtime.InteropServices.WindowsRuntime.ListToBindableVectorAdapter.GetAt(UInt32 index)
    Please give any suggestion to make it work. I was using the longlistselector in windows phone 8.0 using windows phone toolkit and it works fine there.
    Thanks,
    Nitesh

    Hi NiteshKr12,
    Based on your description, I know that when you try to bind 104 items to the ListView, the ListView will crash after scrolling. In my mind, there may be a limit of the pixels that can be displayed on the Windows Phone. Then could you please try to reduce
    some items to see if it can work?
    Besides, could you please try to post a simple reproduce project in here?
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Getting error while submitting application (Windows Phone 8.1 Silver Light Application).The native API api-ms-win-core-synch-l1-2-0.dll:OpenEventA() isn't allowed in assembly . The Assembly is WindowsPhoneSilverLight 8.1 Runtime Component.

    1028: The native API api-ms-win-core-synch-l1-2-0.dll:OpenEventA() isn’t allowed in assembly AnylyncRuntimeComponent.dll.
    Update it and then try again. 
    1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateEventA() isn’t allowed in assembly AnylyncRuntimeComponent.dll.
    Update it and then try again.
     1028: The native API api-ms-win-core-synch-l1-2-0.dll:CreateEventExA() isn’t allowed in assembly AnylyncRuntimeComponent.dll.
    Update it and then try again.
     Can please help to fix this issue . 

    Are you calling OpenEventA, CreateEventA, or CreateEventExA? Those look like legitimate errors: OpenEventA, CreateEventA,
    and CreateEventExA are not supported in Windows Store or Windows Phone apps. OpenEventW and CreateEventExW are allowed so you can use those instead.
    And is this a Windows Store app or a Windows Phone Silverlight app? You gave different details on StackOverflow than you
    do here.

  • Windows Phone - Cannot bind custom user controll with listview item source property

    It is Windows Phone 8.1 (runtime)
    I have some problem of binding custom user controll with list of data. I'll make it simple as I can.
    My problem is that somehow if I use DataBind {Binding Something} inside my custom controll it will not work.
    I need to transfer binded data (string) to custom controll.
    It is strange that if I do not use DataBind, it will work normally. Eg MyCustomControllParameter = "some string" (in my example 'BindingTextValue' property)
    Does anyone Know how to bind custom user controll with inside ListView with DataTemplate.
    Assume this:
    XAML Test-Main page
    <Grid  Background="Black">        <ListView x:Name="TestList" Background="#FFEAEAEA">                    <ListView.ItemTemplate>                <DataTemplate>                    <Grid Background="#FF727272">                        <local:TextBoxS BindingTextValue="{Binding Tag, FallbackValue='aSource'}" local:TextBoxS>                    </Grid>                </DataTemplate>            </ListView.ItemTemplate>        </ListView>    </Grid>
    XAML Test-Main page c#
    public sealed partial class MainPage : Page    {        List<TTag> tags = new List<TTag>();        public MainPage()        {            this.InitializeComponent();            this.NavigationCacheMode = NavigationCacheMode.Required;        }        public class TTag        {            public string Tag { get; set; }        }        private void InitializeAppData()        {            TTag tag = new TTag() { Tag = "hello world" };            tags.Add(tag);            tags.Add(tag);            tags.Add(tag);            TestList.ItemsSource = tags;        }             protected override void OnNavigatedTo(NavigationEventArgs e)        {            InitializeAppData();        }           }
    User Control XAML:
      <UserControl    x:Class="CustomControllTest.TextBoxS"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:local="using:CustomControllTest"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    mc:Ignorable="d"    d:DesignHeight="300"    d:DesignWidth="400">      <Grid x:Name="LayoutRoot" Background="#FF4F4F4F"   >        <RichTextBlock x:Name="MyTestBlock">        </RichTextBlock>    </Grid></UserControl>
    User Control c#
    public TextBoxS()       {            this.InitializeComponent();            LayoutRoot.DataContext = this;        }        public static readonly DependencyProperty BindingTextValueProperty = DependencyProperty.Register(                                         "BindingTextValue",                                         typeof(string),                                         typeof(TextBoxS),                                         new PropertyMetadata(default(string)));        public string BindingTextValue        {            get            {                return GetValue(BindingTextValueProperty) as string;            }            set            {                SetValue(BindingTextValueProperty, value);                //This method adds some custom logic into RichTextBlock, pointed correctly                SetupBox(value);            }        }
    Thanks for helping ;)

    If you use a built-in control rather than your custom control, does binding work? You should verify that first.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • I heve problem with my WCF and Windows phone 8

    This's IserviceBotanero.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.Text;
    namespace WcfServiceBotanero
    // NOTA: puede usar el comando "Rename" del menú "Refactorizar" para cambiar el nombre de interfaz "IServiceBotanero" en el código y en el archivo de configuración a la vez.
    [ServiceContract]
    public class Producto
    int idProducoto;
    [DataMember]
    public int IdProducoto
    get { return idProducoto; }
    set { idProducoto = value; }
    string nombreProductos;
    [DataMember]
    public string NombreProductos
    get { return nombreProductos; }
    set { nombreProductos = value; }
    int cantidad;
    [DataMember]
    public int Cantidad
    get { return cantidad; }
    set { cantidad = value; }
    string precioCompra;
    [DataMember]
    public string PrecioCompra
    get { return precioCompra; }
    set { precioCompra = value; }
    string precioVenta;
    [DataMember]
    public string PrecioVenta
    get { return precioVenta; }
    set { precioVenta = value; }
    string descripcion;
    [DataMember]
    public string Descripcion
    get { return descripcion; }
    set { descripcion = value; }
    [ServiceContract]
    public interface IServiceBotanero
    [OperationContract]
    List<Producto> listado();
    void DoWork();
    this is ServicesBotnero.svc
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.Text;
    namespace WcfServiceBotanero
    // NOTA: puede usar el comando "Rename" del menú "Refactorizar" para cambiar el nombre de clase "ServiceBotanero" en el código, en svc y en el archivo de configuración a la vez.
    // NOTA: para iniciar el Cliente de prueba WCF para probar este servicio, seleccione ServiceBotanero.svc o ServiceBotanero.svc.cs en el Explorador de soluciones e inicie la depuración.
    public class ServiceBotanero : IServiceBotanero
    DataClasseBotaneroDataContext botanero = new DataClasseBotaneroDataContext();
    public List<Producto> listado()
    var qry = from p in botanero.producto
    select new Producto
    IdProducoto = p.idProducoto,
    NombreProductos = p.nombreProducto,
    PrecioCompra = p.precioCompra,
    PrecioVenta = p.precioVenta,
    Descripcion = p.Descripcion
    return qry.ToList();
    public void DoWork()
    page view 
    <phone:PhoneApplicationPage
    x:Class="PhoneApp1.PageProductolocal"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    <!--LayoutRoot es la cuadrícula raíz donde se coloca todo el contenido de la página-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <!--TitlePanel contiene el nombre de la aplicación y el título de la página-->
    <StackPanel Grid.Row="0" Margin="12,17,0,28">
    <TextBlock Style="{StaticResource PhoneTextNormalStyle}">
    <Run Text="Productos"/>
    <LineBreak/>
    <Run/>
    </TextBlock>
    </StackPanel>
    <!--ContentPanel. Colocar aquí el contenido adicional-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <ListBox x:Name="ldlProducto" >
    <ListBox.ItemTemplate>
    <DataTemplate>
    <StackPanel HorizontalAlignment="Center">
    <TextBlock Padding="10" Text="{Binding IdProducto }" ></TextBlock>
    <TextBlock Text="{Binding NombreProduco }" ></TextBlock>
    <TextBlock Text="{Binding PrecioCompra }" ></TextBlock>
    <TextBlock Text="{Binding PrecioVenta }" ></TextBlock>
    <TextBlock Text="{Binding Cantidad }" ></TextBlock>
    <TextBlock Text="{Binding Descripcion }" ></TextBlock>
    </StackPanel>
    </DataTemplate>
    </ListBox.ItemTemplate>
    </ListBox>
    </Grid>
    </Grid>
    </phone:PhoneApplicationPage>
    PageProductolocal.xaml.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Documents; //
    using System.Windows.Input; //
    using System.Windows.Media; //
    using System.Windows.Media.Animation; //
    using System.Windows.Shapes; //
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Shell;
    using PhoneApp1.ServiceReferenceBotanero;
    namespace PhoneApp1
    public partial class PageProductolocal : PhoneApplicationPage
    public PageProductolocal()
    InitializeComponent();
    //instancia o Referencia al wcf
    ServiceBotaneroClient proxy = new ServiceBotaneroClient();
    proxy.listadoCompleted += new EventHandler<listadoCompletedEventArgs>(listado);
    proxy.listadoAsync();
    private void listado(object sender, listadoCompletedEventArgs e)
    if (e.Error == null)
    ldlProducto.ItemsSource = e.Result;
    and SW Runing
    So and this is the error shown
    El código de usuario no controló System.ServiceModel.CommunicationException
    HResult=-2146233087
    Message=The remote server returned an error: NotFound.
    Source=System.ServiceModel
    StackTrace:
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
    at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
    at PhoneApp1.ServiceReferenceBotanero.ServiceBotaneroClient.ServiceBotaneroClientChannel.Endlistado(IAsyncResult result)
    at PhoneApp1.ServiceReferenceBotanero.ServiceBotaneroClient.PhoneApp1.ServiceReferenceBotanero.IServiceBotanero.Endlistado(IAsyncResult result)
    at PhoneApp1.ServiceReferenceBotanero.ServiceBotaneroClient.OnEndlistado(IAsyncResult result)
    at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
    InnerException: System.Net.WebException
    HResult=-2146233079
    Message=The remote server returned an error: NotFound.
    Source=System.Windows
    StackTrace:
    at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
    at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
    InnerException: System.Net.WebException
    HResult=-2146233079
    Message=The remote server returned an error: NotFound.
    Source=System.Windows
    StackTrace:
    at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
    at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
    at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
    InnerException:
    That is not what I need or what the error if 
    Help Me!

    Hi,
    You could try to use HttpClient to consume wcf in windows phone 8.
    Here is an exsample you could refer:
    http://stackoverflow.com/questions/21536825/windows-phone-8-call-wcf-web-service
    Besides, you could refer to :
    http://www.codeproject.com/Questions/691619/Consuming-WCF-Service-from-Windows-Phone
    Since this issue is more related to Windows Phone, If my reply no help, please move to Windows Phone forum for a better support, It is appropriate and more experts will assist you.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • How to display UI elements dynamically on the click of a radiobutton

    hi all, I have created two radio buttons rb1, rb2 dynamically.  If i click on rb1, ...... one label, one inputfield (ie., some UI elements ) must be displayed in the same view & if i click on rb2, other UI elements must display.  can anyone tell how

  • Error in Windows 7: User Profile Service was not logged on. The user and administra​torprofile

    Error in Windows 7: User Profile Service was not logged on. The user profile can not be loaded. Administrator profile and the code does not work. What do I do? HP G5384sc desktop pc

  • Work flow builder issue

    Hi, Workflow is getting deactivated in production system after Upgrade, this is happening only in production system, we are activating it manually each day,.This does not happen in Dev and Quality systems, Please help. Regards, Rajiv

  • Black lines show up on final print

    In CS4 when ever I save to PDF and try to print my document these horizontal black lines show up.  They are most notable around areas with varying transparency. This happen to anyone else? Any ideas?

  • How to get it to start up???

    This has got to be easy! OK, I have downloaded the Sun Java software, and can see that it resides in a directory on my c-drive., viz. c:\j2sdk1.4.2_11. Now how do I actually make it start up? Was there supposed to be an icon created on my desktop tha