{"id":259,"date":"2013-12-01T16:52:09","date_gmt":"2013-12-01T14:52:09","guid":{"rendered":"http:\/\/atp4kids.wordpress.com\/?p=259"},"modified":"2013-12-01T16:52:09","modified_gmt":"2013-12-01T14:52:09","slug":"windows-phone-calculator-by-lubomir-marinski","status":"publish","type":"post","link":"https:\/\/atp.bfu.bg\/?p=259","title":{"rendered":"Windows Phone Calculator by Lubomir Marinski"},"content":{"rendered":"<p><a href=\"https:\/\/atp.bfu.bg\/wp-content\/uploads\/2013\/12\/phone.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-260\" alt=\"phone\" src=\"https:\/\/atp.bfu.bg\/wp-content\/uploads\/2013\/12\/phone.jpg?w=300\" width=\"300\" height=\"168\" srcset=\"https:\/\/atp.bfu.bg\/wp-content\/uploads\/2013\/12\/phone.jpg 1920w, https:\/\/atp.bfu.bg\/wp-content\/uploads\/2013\/12\/phone-300x168.jpg 300w, https:\/\/atp.bfu.bg\/wp-content\/uploads\/2013\/12\/phone-1024x576.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>using System;<br \/>\nusing System.Collections.Generic;<br \/>\nusing System.Linq;<br \/>\nusing System.Net;<br \/>\nusing System.Windows;<br \/>\nusing System.Windows.Controls;<br \/>\nusing System.Windows.Navigation;<br \/>\nusing Microsoft.Phone.Controls;<br \/>\nusing Microsoft.Phone.Shell;<br \/>\nusing PhoneApp3.Resources;<\/p>\n<p>namespace PhoneApp3<br \/>\n{<br \/>\npublic partial class MainPage : PhoneApplicationPage<br \/>\n{<br \/>\n\/\/ Constructor<br \/>\npublic MainPage()<br \/>\n{<br \/>\nInitializeComponent();<\/p>\n<p>\/\/ Sample code to localize the ApplicationBar<br \/>\n\/\/BuildLocalizedApplicationBar();<br \/>\n}<\/p>\n<p>public double z = 0, a = 0, c = 0,s=0,b=0;<\/p>\n<p>private void button1_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;1&#8220;;<br \/>\n}<\/p>\n<p>private void button2_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;2&#8220;;<br \/>\n}<\/p>\n<p>private void button3_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;3&#8220;;<br \/>\n}<\/p>\n<p>private void button4_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;4&#8220;;<br \/>\n}<\/p>\n<p>private void button5_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;5&#8220;;<br \/>\n}<br \/>\nprivate void button6_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;6&#8220;;<br \/>\n}<\/p>\n<p>private void button7_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;7&#8220;;<br \/>\n}<\/p>\n<p>private void button8_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;8&#8220;;<br \/>\n}<\/p>\n<p>private void button9_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;9&#8220;;<br \/>\n}<br \/>\n\/\/ +<br \/>\nprivate void buttonx_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\nb = double.Parse(textBox1.Text);<br \/>\nc = b;<br \/>\ntextBox1.Text = &#8222;&#8220;;<br \/>\nz = 1;<br \/>\n}<br \/>\n\/\/ &#8211;<br \/>\nprivate void buttonx1_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\nb = double.Parse(textBox1.Text);<br \/>\nc = b;<br \/>\ntextBox1.Text = &#8222;&#8220;;<br \/>\nz = 2;<br \/>\n}<\/p>\n<p>private void buttonx2_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\nb = double.Parse(textBox1.Text);<br \/>\nc = b;<br \/>\ntextBox1.Text = &#8222;&#8220;;<br \/>\nz = 3;<br \/>\n}<\/p>\n<p>private void buttonx3_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\nb = double.Parse(textBox1.Text);<br \/>\nc = b;<br \/>\ntextBox1.Text = &#8222;&#8220;;<br \/>\nz = 4;<br \/>\n}<\/p>\n<p>private void buttonz_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\nvar p = double.Parse(textBox1.Text);<br \/>\nif (z == 1) s = b + p;<br \/>\nif (z == 2) s = b &#8211; p;<br \/>\nif (z == 3) s = b * p;<br \/>\nif (z == 4) s = b \/ p;<br \/>\ntextBox1.Text = System.Convert.ToString(s);<br \/>\n}<\/p>\n<p>private void button0_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text += &#8222;0&#8220;;<br \/>\n}<\/p>\n<p>private void buttonc_Click(object sender, RoutedEventArgs e)<br \/>\n{<br \/>\ntextBox1.Text = &#8222;&#8220;;<br \/>\n}<\/p>\n<p>\/\/ Sample code for building a localized ApplicationBar<br \/>\n\/\/private void BuildLocalizedApplicationBar()<br \/>\n\/\/{<br \/>\n\/\/\u00a0\u00a0\u00a0 \/\/ Set the page&#8217;s ApplicationBar to a new instance of ApplicationBar.<br \/>\n\/\/\u00a0\u00a0\u00a0 ApplicationBar = new ApplicationBar();<\/p>\n<p>\/\/\u00a0\u00a0\u00a0 \/\/ Create a new button and set the text value to the localized string from AppResources.<br \/>\n\/\/\u00a0\u00a0\u00a0 ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri(&#8222;\/Assets\/AppBar\/appbar.add.rest.png&#8220;, UriKind.Relative));<br \/>\n\/\/\u00a0\u00a0\u00a0 appBarButton.Text = AppResources.AppBarButtonText;<br \/>\n\/\/\u00a0\u00a0\u00a0 ApplicationBar.Buttons.Add(appBarButton);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0 \/\/ Create a new menu item with the localized string from AppResources.<br \/>\n\/\/\u00a0\u00a0\u00a0 ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);<br \/>\n\/\/\u00a0\u00a0\u00a0 ApplicationBar.MenuItems.Add(appBarMenuItem);<br \/>\n\/\/}<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using PhoneApp3.Resources; namespace PhoneApp3 { public partial class MainPage : PhoneApplicationPage { \/\/ Constructor public MainPage() { InitializeComponent(); \/\/ Sample code to localize the ApplicationBar \/\/BuildLocalizedApplicationBar(); } public double z = 0, a = 0, c = &hellip; <a href=\"https:\/\/atp.bfu.bg\/?p=259\" class=\"more-link\">\u041d\u0430\u0442\u0430\u0442\u044a\u043a <span class=\"screen-reader-text\">Windows Phone Calculator by Lubomir Marinski<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-4"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4l2be-4b","_links":{"self":[{"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":0,"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"wp:attachment":[{"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atp.bfu.bg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}