C # nineth Session

Source: Internet
Author: User

This lesson is mainly about demonstrating the various experimental procedures.

Say a few feelings

The ideas are great!

I think we are all very good ... For example, Wwx game, using the game engine ... It's said that LTP's team also used the game engine.

Second, I think this front end seems to have no art bacteria! The interface is not very beautiful ....

Some of the more novel features are those embedded in the game engine ...

Then found some of their own group of deficiencies ... For example, the database is relatively weak ... Of course our program is not related to the database. But the database still needs to learn.

Say a little bit about the technique of group experiment

WPF platform Jump I used a code like this to implement

Private void Allaccount_click (object  sender, MouseButtonEventArgs e) {    new  allaccount ();      This . Close ();    Win. Show ();}

But I had a problem. is completely limited ... I don't know how to pass the parameters ....

Because it's used in Win8app.

Private void backButton_Click (object  sender, RoutedEventArgs e)        {            varNew  Frame ();            Frame. Navigate (typeof(MainPage));             = frame;            Window.Current.Activate ();        }

Here in the navigate can add parameters such as

Frame. Navigate (typeof(MainPage), PageID);

But I don't know how to do it on the top.

Later found that can also be so ...

Let's just set up a constructor with parameters in the windows that we want to instantiate.

And then when we instantiate it, we can pass that parameter as a constructor parameter.

This is really better than my previous approach.

In the previous method, I declared a static int value as a global variable in APP.cs.

However, in the development of the application of global variables is very easy to trouble ... One of the main features of object-oriented is

Each object only handles data that is relevant to itself. Do not control the content of others ....

So the method of communication here needs to learn

Next, in WPF development ... Problem with page size stretch encountered

<ViewboxStretch= "Fill">    <Grid>        <ButtonContent= "Back"HorizontalAlignment= "Left"Margin= "407,270,0,0"VerticalAlignment= "Top"Width= " the"Click= "Button_Click"/>        <ListViewItemsSource="{Binding}"HorizontalAlignment= "Left"Height= "183"Margin= "0,61,0,0"VerticalAlignment= "Top"Width= "482">            <listview.itemtemplate>                <DataTemplate>                    <StackPanelOrientation= "Horizontal">                        <TextBlockText="{Binding Usage}"FontSize= "+"/>                        <StackPanel>                            <TextBlockText="{Binding Time}"FontSize= "Ten"/>                            <TextBlockText="{Binding Amount}"FontSize= "Ten" />                            <TextBlockText="{Binding Remark}"  />                            <ButtonName= "DeleteButton"Click= "Delete_click"Tag="{Binding Id}"Content= "Delete"FontSize= "Ten"></Button>                            <ButtonName= "Editbutton"Click= "Edit_click"Tag="{Binding Id}"Content= "Edit"FontSize= "Ten"></Button>                        </StackPanel>                    </StackPanel>                </DataTemplate>            </listview.itemtemplate>        </ListView>        <TextBoxHorizontalAlignment= "Left"Height= "Panax Notoginseng"Margin= "39,19,0,0"textwrapping= "Wrap"Text= "All Bills"VerticalAlignment= "Top"Width= "133"FontSize= "+"/>    </Grid></Viewbox>Notice here that I set up a viewbox outside, which is used to solve the problem that the content does not change when the program is stretched. With this viewbox, and setting Viewbox's stretch to fill, all controls inside the Viewbox are stretched and shrunk with the aspect ratio. To achieve this function. 

is also more convenient ... Stretch here are four options. Fill is exactly the same as the change ... There are other changes such as the fixed length-to-width ratio changes ...

This property is not just used here ... Image there can also be used ... It's convenient.

The main time of the week was to write an experiment. Here are two tips ... Specific content, such as the experimental code will be on the shelves and then in the follow-up update with teammates to discuss the code to open up to let more people discuss the point of our imperfections ... That's it!

C # nineth Session

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.