Hub App .... within Hub Sections objects not recognized in code

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

40 Replies - 1896 Views - Last Post: 10 August 2014 - 04:57 PM Rate Topic: -----

#31 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 02 August 2014 - 07:24 PM

View Post_HAWK_, on 02 August 2014 - 07:58 PM, said:

This is a very confusing layout indeed?!? You have UC1 that has an instance of UC2 which by it's own definition has an instance of UC1 in it - which means it too has an instance of UC2 and so on and so forth - sound like infinity to me! Rethink the design I think it is a bit messed up here. Think of the logic and what exactly the UC's are supposed to do - encapsulate code and controls for repetition of work.

Where can I place these declarations/instances in the code? The HubPage.xaml.vb? I've tried there and the other UC classes have errors saying: 'sec1' or 'sec2' or 'sec3' is not declared. It may be inaccessible due to is protection level.
Was This Post Helpful? 0
  • +
  • -

#32 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 70
  • View blog
  • Posts: 565
  • Joined: 05-December 13

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 02 August 2014 - 07:37 PM

I went over this one with you a few pages back. I really think you should scrap it and redo it from the start while thinking out the logic and studying the documentation. If you go back in posts, do what i suggested before, and what Hawk said. It at least should execute then. Biggest problems seem to be your classes... If you need to access something in another class, what do you do?
Was This Post Helpful? 0
  • +
  • -

#33 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 02 August 2014 - 08:04 PM

View PostSheepings, on 02 August 2014 - 09:37 PM, said:

I went over this one with you a few pages back. I really think you should scrap it and redo it from the start while thinking out the logic and studying the documentation. If you go back in posts, do what i suggested before, and what Hawk said. It at least should execute then. Biggest problems seem to be your classes... If you need to access something in another class, what do you do?

Umm ... I understand what is happening, but I'm still stuck with hubsections not being able to communicating when all of the controls are trap inside the <DataTemplates>. I don't know how to get past that.

I am great at make windows form apps/desktop apps, but i just have been having a hard time with these windows 8.1 apps, the xaml aspect of it. Its very frustrating. I'm sorry if I am causing any of you to get frustrated with me as well, I just am lost with these xaml coding ...
Was This Post Helpful? 0
  • +
  • -

#34 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 02 August 2014 - 08:36 PM

Frustrated with the datatemplates and hubsections, i just created a blank app and am now trying out just using grids within a scrollviewer. Each "section"/grid is seperated by the use of margins. Now I can address a control in the code without any worries! I'll let you know how this goes, but this may have to be the way for me to go.
Was This Post Helpful? 0
  • +
  • -

#35 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 70
  • View blog
  • Posts: 565
  • Joined: 05-December 13

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 03 August 2014 - 07:10 AM

Javmiller if you double back a page or so, you may have had this working. I think the actual problem might be in your usercontrol.
Paste this below any class:
Public Class Tmp1
    Public Shared WithEvents MyTreeView As Windows.Forms.TreeView
    Public Shared Sub Test1()
        MyTreeView.Nodes.Add("Foo1")
    End Sub
End Class
Public Class Tmp2
    Public Shared Sub Test2()
        Tmp1.MyTreeView.Nodes.Add("Foo2")
        MyTreeView.Nodes.Add("FooFoo2")
    End Sub
End Class
Public Class Tmp3
    Public Sub Test3()
        MyTreeView.Nodes.Add("FooFoo3")
        Tmp1.MyTreeView.Nodes.Add("FooFoo4")
    End Sub
End Class

You will notice some of these lines have errors already and that's meant to be like so, read them by hovering over them and ask google about the error line. Because I can't see you getting this working unless someone steps into your PC for you. However, If you change
Public Shared WithEvents MyTreeView As Windows.Forms.TreeView
to Private Shared WithEvents, watch what happens to the other lines. Look familiar? Also remove the ' Shared ' part and set it to Public WithEvents. I think this will help you to understand the functionality you need to conduct in your apps direction. Now once you work out what I am showing you, look at your own declarations in your classes and usercontols.

Edit: Added tag formatting

This post has been edited by Sheepings: 03 August 2014 - 07:11 AM

Was This Post Helpful? 0
  • +
  • -

#36 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 03 August 2014 - 04:32 PM

Thanks, but they're listviews not treeviews. But this doesn't work since it works the same as i had before; it's just simplifed and neater. i am now getting the same errors i originally gotten. I am okay with using the blank app and grids.

This post has been edited by andrewsw: 03 August 2014 - 04:51 PM
Reason for edit:: Removed large previous quote, press REPLY

Was This Post Helpful? 0
  • +
  • -

#37 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3467
  • View blog
  • Posts: 11,768
  • Joined: 12-December 12

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 03 August 2014 - 04:52 PM

@OP There is no need to quote the (large) previous post every time, there is a large Reply button further down the page.
Was This Post Helpful? 0
  • +
  • -

#38 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 03 August 2014 - 04:56 PM

ok thanks
Was This Post Helpful? 0
  • +
  • -

#39 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 70
  • View blog
  • Posts: 565
  • Joined: 05-December 13

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 03 August 2014 - 05:55 PM

As I explained on page two. I know you're not using a treeview, you can change that to any control, (this demonstration is showing you the same issue as your usercontrol.) You don't have to do anything except paste that code under your own class and hover your mouse over it to see why the errors appear, and you can see what conditions cause the error you are having if you change the lines I mentioned above. It will clear up what i said on page 2.

Good luck.
Was This Post Helpful? 0
  • +
  • -

#40 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 10 August 2014 - 03:26 PM

OK I am happy to inform all of you that I have successfully completed the majority of my app the way I want it, by using a blank app with the grids spaced apart by adjusting the margins while inside a scrollviewer.

Now i want to be able to keep the listviews in the app, keeping the info saved when the app is closed. I have an idea of how to do this in a desktop app, but not in the Windows Store app. How is this done?

(FYI: All of my Listviews only contain one column and I only need to save the items in the listviews, not the headers.)

This post has been edited by javmiller: 10 August 2014 - 03:36 PM

Was This Post Helpful? 0
  • +
  • -

#41 javmiller  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-May 11

Re: Hub App .... within Hub Sections objects not recognized in code

Posted 10 August 2014 - 04:57 PM

I realized that i will also need the check state of an appbartogglebutton saved on app close. I need to know how to do this as well. Thanks for any further help in advanced.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3